Advertisement
STANAANDREY

c

Nov 22nd, 2018
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;// |
  4.  
  5.     int main () {
  6.  
  7.     int a,b;
  8.     cout<<"a=";cin>>a;
  9.     cout<<"b=";cin>>b;
  10.     while (a!=b)
  11.     {
  12.         if (a>b)
  13.             a-=b;
  14.         else
  15.             b-=a;
  16.     }
  17.  
  18.     cout<<"cmmdc= "<<a;
  19.  
  20.     return 0;
  21.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement