|
|
вернуться в форумПоказать все сообщения Спрятать все сообщения#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; } include what? gcd is wrong too! #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! Not complited first line, i suppose: #include (what??) |
|
|