Advertisement
SergeyPGUTI

4.1.6

Oct 2nd, 2015
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.22 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     int a,b;
  9.     cin>>a>>b;
  10.     for(;a!=b;)
  11.     {
  12.             if (a>b) a=a-b;
  13.             else b=b-a;
  14.     }
  15.     cout<<a;
  16.     return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement