Advertisement
SergeyPGUTI

5.1.2

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