Advertisement
ValerianBenchea

CMMDC

Oct 23rd, 2019
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.27 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     int a, b;
  7.     cout<<"a="; cin>>a;
  8.     cout<<"b="; cin>>b;
  9.     while(a!=b)
  10.         if(a>b)
  11.         a=a-b;
  12.         else
  13.         b=b-a;
  14.  
  15.     cout<<"Cel mai mare divizor comun este "<<a;
  16.  
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement