Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int a, b, i, j;
- int main()
- {
- cin>>a>>b;
- for (i=1; i<=a; i++)
- { if (a%i==0)
- { for (j=1; j<=b; j++)
- { if (b%j==0 && i==j)
- cout<<i<<" ";
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement