From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,44035ca3ad75f32b X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news3.google.com!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread3.news.pas.earthlink.net.POSTED!a6202946!not-for-mail From: "Jeffrey R. Carter" Organization: jrcarter at acm dot org User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: integers into strings References: <1138844312.140458.73880@z14g2000cwz.googlegroups.com> In-Reply-To: <1138844312.140458.73880@z14g2000cwz.googlegroups.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <5XdEf.326$UF1.191@newsread3.news.pas.earthlink.net> Date: Thu, 02 Feb 2006 02:15:29 GMT NNTP-Posting-Host: 67.3.229.32 X-Complaints-To: abuse@earthlink.net X-Trace: newsread3.news.pas.earthlink.net 1138846529 67.3.229.32 (Wed, 01 Feb 2006 18:15:29 PST) NNTP-Posting-Date: Wed, 01 Feb 2006 18:15:29 PST Xref: g2news1.google.com comp.lang.ada:2743 Date: 2006-02-02T02:15:29+00:00 List-Id: isaac_2004@yahoo.com wrote: > hi im new to ada and i want to take a number inputted from a user and > seperate the digits then arrange it in ascending and descending order > and subtract and ascending number from the descending number > > for example > > user inputs 7319 > > program outputs 9731 - 1379 = 8352 'Image converts a scalar into a String; 'Value works the other way. Integer'Image (7319) = " 7319". Integer'Value ("9731") = 9731. However, if you're getting the number from input, you could just input it as a String and skip the 1st step. -- Jeff Carter "My name is Jim, but most people call me ... Jim." Blazing Saddles 39