comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: Algorithms Homework Help?!?!
Date: Tue, 15 Jan 2013 16:54:19 -0700
Date: 2013-01-15T16:54:19-07:00	[thread overview]
Message-ID: <kd4q7c$l4a$2@dont-email.me> (raw)
In-Reply-To: <fd8f40f1-8d31-4a99-8828-16e155d045d4@googlegroups.com>

On 01/15/2013 02:52 PM, willmann817 wrote:
>
>     function Candy(Kids : Integer; MsPerColor : Int_Array) return Integer is	
> 	lo : Integer := 1;
> 	hi : Integer := 50000;
> 	mid : Integer;
> 	begin
> 		for I in MsPerColor'Range loop
> 			if  MsPerColor(I) > hi then
> 				hi :=  MsPerColor(I);
> 			end if;
> 			if  MsPerColor(I) < lo then
> 				lo :=  MsPerColor(I);
> 			end if;
> 		end loop;

Will you ever have more than 50,000 M&Ms of any one color? If not, then Hi will 
remain 50,000. Will you ever have less than 1 M&M of any one color? If not, then 
Lo will remain 1.

-- 
Jeff Carter
"My legs are gray, my ears are gnarled, my eyes are old and bent."
Monty Python's Life of Brian
81



  parent reply	other threads:[~2013-01-15 23:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-15 21:52 Algorithms Homework Help?!?! willmann817
2013-01-15 22:50 ` Adam Beneschan
2013-01-15 23:50   ` willmann817
2013-01-15 23:43 ` Shark8
2013-01-15 23:54 ` Jeffrey Carter [this message]
2013-01-16  0:01   ` willmann817
2013-01-16  3:54     ` willmann817
2013-01-16 19:47 ` Robert A Duff
2013-01-16 21:19   ` Adam Beneschan
2013-01-16 22:27     ` Robert A Duff
2013-01-16 23:43       ` Adam Beneschan
2013-02-07  7:06 ` ajim
2013-02-07  7:10 ` ajim
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox