#include #include using namespace std; int gcd(int a, int b) { if ((a==0)||(b==0)) return abs(a+b); else { int x,y,z; x=abs(a); y=abs(b); for (z=1; z!=0; ) { z=x%y; x=y; y=z; } return x; } } int main() { int a,b; ifstream fi; fi.open("gcd.in"); fi>>a>>b; fi.close(); ofstream fo; fo.open("gcd.out"); fo<