fork download
  1. #include<stdio.h>
  2. int gcd(int,int);
  3. int main()
  4. {
  5. int m,n,ans;
  6. scanf("%d",&m);
  7. scanf("%d",&n);
  8. while(m!=n)
  9. {
  10. if(m>n)
  11. {
  12. m=m-n;
  13. }
  14. else
  15. {
  16. n=n-m;
  17. }
  18. }
  19. printf("%d",m);
  20. return 0;
  21. }
Success #stdin #stdout 1.1s 5280KB
stdin
Standard input is empty
stdout
-2147483645