Advertisement
STANAANDREY

cmmdc dif

Oct 5th, 2021
995
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. using namespace std;
  3.  
  4. int main() {
  5.     int a, b;
  6.     cin >> a >> b;
  7.     while (a != b) {
  8.         if (a > b) {
  9.             a -= b;
  10.         } else {
  11.             b -= a;
  12.         }
  13.     }
  14.     cout << "cmmdc=" << a << endl;
  15.     return 0;
  16. }
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement