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!news4.google.com!news.glorb.com!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread1.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> <5XdEf.326$UF1.191@newsread3.news.pas.earthlink.net> <1138851785.180604.32910@g47g2000cwa.googlegroups.com> In-Reply-To: <1138851785.180604.32910@g47g2000cwa.googlegroups.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Thu, 02 Feb 2006 19:32:54 GMT NNTP-Posting-Host: 67.3.210.241 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.news.pas.earthlink.net 1138908774 67.3.210.241 (Thu, 02 Feb 2006 11:32:54 PST) NNTP-Posting-Date: Thu, 02 Feb 2006 11:32:54 PST Xref: g2news1.google.com comp.lang.ada:2751 Date: 2006-02-02T19:32:54+00:00 List-Id: isaac2004 wrote: > no im not converting the inputted number into a string im sorting the > digits of the value into ascending and descending order and then making > two different numbers out of it one ascending one descending I suppose you could pull off the digits using "rem" and "/", sort those, and put them back together using "*" and "+", but it seems easier to deal with the numbers as Strings and the digits as Characters. In any case, you're going to input the number as Characters. You may hide this by using something like Ada.Text_IO.Integer_IO, but the actual input is a sequence of characters, which is then interpreted as the image of a value of an integer type and converted to the corresponding value. That's why it's called "Text I/O". If you do decide to do the sorting with Characters, you can make things a little easier by simply inputting the number as a String. -- Jeff Carter "I would never want to belong to any club that would have someone like me for a member." Annie Hall 41