Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <algorithm>
- using namespace std;
- int main()
- {
- int a=0, b=0, n=1;
- cin >> a >> b;
- while (a!=0 && b!=0)
- {
- if (a%2 ==0 && b%2==0)
- {
- while (a%2!=0 || b%2!=0 || (a%2!=0 && b%2!=0))
- {
- a/=2;
- b/=2;
- n*=2;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement