Advertisement
icatalin

cmmmdc

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