ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1053. Pinocchio

I am david. Tabo. whi i got CE [3] // Problem 1053. Pinocchio 16 May 2002 10:51
#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;
}
ECUST Multistar Re: whi i got CE // Problem 1053. Pinocchio 23 May 2002 16:40
include what?
gcd is wrong too!
PockaTa Re: whi i got CE // Problem 1053. Pinocchio 14 Feb 2009 15:22
#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!
melkiy Re: whi i got CE // Problem 1053. Pinocchio 15 Feb 2009 18:07
Not complited first line, i suppose:

#include (what??)