Cod sursa(job #1342089)
Utilizator | Data | 13 februarie 2015 15:20:18 | |
---|---|---|---|
Problema | Jocul Flip | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.35 kb |
#include <fstream>
using namespace std;
ifstream fin("euclid2.in");
ofstream fout("euclid2.out");
int x,y;
int gcd(int a, int b)
{
if (!b)
if(x%a+y%a==0)
return 0;
else
return a;
else
return gcd(b, a%b);
}
int main() {
fin>>x>>y;
fout<<gcd(x,y);
return 0;
}