Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main ()
- {
- short int n, x, y;
- cin >> n;
- if (n > 20) n = 20; // !!
- for (short int licznik = 0; licznik < n; ++licznik)
- {
- cin >> x >> y;
- short int iloczyn = x*y;
- do
- {
- if(x>y) x=x-y;
- else y=y-x;
- }
- while(x!=y);
- cout << iloczyn/x << "\n";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement