HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Forums > Discussion of problems > topic:


Problem "Greatest common divisor"

There is a contest!

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

imesecanFeb.20.2011 at 02:21:13 PM
0int x,y,rem=0;

cin>>x>>y;
// After you read x and y you must make sure that
// x is greater than y. Did you check for this ? :)

while (y!=0)
{
rem=x%y;
y=x; // I think this has to be reverse x=y;
y=rem;
}

// When you quit from the loop y is already 0; Are you sure to show this 0?
cout<<y;


www.contester.ru