|
|
back to boardwhi i got CE #include int gcd( int a, int b ){ return b ? gcd( b, a%b ) : a; } int main () { int n, L, g=0; cin >> n; while( cin >> L ) g=gcd( L, g ); cout << g << endl; } Re: whi i got CE include what? gcd is wrong too! Re: whi i got CE #include <iostream> using namespace std; int gcd( int a, int b ) { return b ? gcd( b, a%b ) : a; } int main () { int n, L, g=0; cin >> n; while( cin >> L ) g=gcd( L, g ); cout << g << endl; } Change your code to this and it runs perfectly! Re: whi i got CE Posted by strider 15 Feb 2009 18:07 Not complited first line, i suppose: #include (what??) |
|
|