fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int NOD(int a,int b)
  6. {
  7. if (a == b) return a;
  8. else
  9. {
  10. if (a > b) a=a-b;
  11. else b=b-a;
  12. }
  13. }
  14. int main()
  15. {
  16. int q,w;
  17. cin >> q >> w;
  18. cout << NOD(q,w);
  19. }
Success #stdin #stdout 0s 4276KB
stdin
Standard input is empty
stdout
Standard output is empty