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,2ac407a2a34565a9 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Received: by 10.68.221.4 with SMTP id qa4mr17222312pbc.7.1330476098426; Tue, 28 Feb 2012 16:41:38 -0800 (PST) Path: h9ni20907pbe.0!nntp.google.com!news2.google.com!postnews.google.com!j8g2000yqm.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Array Help? Date: Tue, 28 Feb 2012 16:24:38 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <10615783-d4a9-4cbd-8971-53ba1100d6a0@b18g2000vbz.googlegroups.com> <87mx828z3l.fsf@ludovic-brenta.org> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 X-Trace: posting.google.com 1330476098 18821 127.0.0.1 (29 Feb 2012 00:41:38 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 29 Feb 2012 00:41:38 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: j8g2000yqm.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: ARLUEHNKC X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618; .NET4.0C),gzip(gfe) Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-02-28T16:24:38-08:00 List-Id: On Feb 28, 12:47=A0pm, Ludovic Brenta wrote: > Will writes on comp.lang.ada: > > > Hello all, > > > I am looking for your help again. =A0I know how to refer to a certain > > index in an array. for example if some array A is (53,83,3,62,3,13) > > then A(4) =3D 62 =A0 but what if I wanted to go through an array and > > identify certain indexes by what they contain? =A0In my particular case > > I need to identify the indexes that have numbers in them that do not > > end in 1 or 2. =A0 These numbers range from 1 to 4 digits. =A0Any ideas= on > > how I can do this? > > > Thanks a bunch > > Since this looks very much like a school assignment, my answer will be > in English rather than Ada :) > > Traverse the array. =A0Each element in the array is an integer; take that > integer modulo 10. That'll work if each element of the array is a NATURAL or a POSITIVE. If it's possible for A to contain any negative integers, then a more careful statement of the problem is needed (does "ends in 1 or 2" mean what it looks like?), and some extra thought is needed to get that case right. -- Adam