fork download
  1. #include <stdio.h>
  2.  
  3. int main(void)
  4. {
  5. int a, b, min, max;
  6.  
  7. if (scanf("%d %d", &a, &b) != 2) {
  8. printf("Input error");
  9. return 0;
  10. }
  11.  
  12. if (a < b) {
  13. min = a;
  14. max = b;
  15. } else {
  16. min = b;
  17. max = a;
  18. }
  19.  
  20. while(min > 0) {
  21. int var_tmp = min;
  22. min = max % min;
  23. max = var_tmp;
  24. }
  25.  
  26. printf("%d", max);
  27.  
  28. return 0;
  29. }
Success #stdin #stdout 0s 5316KB
stdin
Standard input is empty
stdout
Input error