ValerianBenchea

CMMDC cu impartire

Jan 15th, 2020
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.26 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int a, b, r, d;
  8.     cout<<"a="; cin>>a;
  9.     cout<<"b="; cin>>b;
  10.     r=a%b;
  11.     while(r!=0)
  12.     {
  13.         a=b;
  14.         b=r;
  15.         r=a%b;
  16.     }
  17.     cout<<"CMMDC este "<<b;
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment