Advertisement
Josif_tepe

Untitled

Apr 5th, 2024
812
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. #include <algorithm>
  3. using namespace std;
  4.  
  5.  
  6. int main()
  7. {
  8.     int a, b;
  9.     cin >> a >> b;
  10.    
  11.     for(int i = 1; i <= a; i++) {
  12.         if(a % i == 0 and b % i == 0) {
  13.             cout << i << endl;
  14.         }
  15.     }
  16.     return 0;
  17. }
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement