Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- main()
- {
- int m, n, s = 0;
- cin >> m >> n;
- while (m>0 && n>0)
- {
- while(m>=n && n!=0 && m!=0)
- {
- m = m - n;
- s++;
- }
- while(n>=m && n!=0 && m!=0)
- {
- n = n - m;
- s++;
- }
- }
- cout << s-1 << endl;
- system ("PAUSE");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement