Search found 1 match

by kaiser-sose
Thu Apr 01, 2004 11:05 am
Forum: Volume 103 (10300-10399)
Topic: 10368 - Euclid's Game
Replies: 14
Views: 7697

10368

does somebody have test cases?
what is wrong of that code?

thanks
#include <iostream>
using namespace std;

int main(){
int a,b,c;
cin>>a;
cin>>b;

while ((a!=0) || (b!=0)){
if (a<b) {c=a;a=b;b=c;}
int i=0;

while (b!=0) { i++;
if (a>=2*b) {b=0;} else {a=a-b;}
if (a<b) {c=a;a=b;b=c;}
}

if (i%2 ...

Go to advanced search