HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Forums > Discussion of problems > topic:


Problem "The smallest number"

There is a contest!

В настоящий момент идёт турнир. Некоторая информация и функции сервера недоступны до его окончания.

imesecanFeb.13.2011 at 08:02:53 AM
0We take the first number as the smallest, then starting from the second number until the last item, we compare the smallest item with the active element.

If active element is smaller than the min, we assign this number (active element) to min.

imesecanFeb.17.2011 at 08:12:49 AM
1You assign the first array element to min before the loop.

min=a[0];

Then in the loop,

for(int i=1; i<=num; i++)

check all the elements one by if that is smaller than min
if (a[i]<min)

if it's smaller we say
min = a[i];

imesecanFeb.25.2011 at 07:57:15 AM
2You have put
system("Pause");
You shouldn't use such extra info when entering codes to the site.

Please don't submit full code to the site.

imesecanApr.07.2011 at 10:08:38 AM
3Post is deleted


www.contester.ru