Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main()
- {
- ios_base::sync_with_stdio(false);
- int a, b;
- cin >> a >> b;
- int koren = sqrt(a);
- int res = 0;
- for(int i = 1; i <= koren; i++) {
- if(a % i == 0) {
- if(b % i == 0) {
- res++;
- }
- int d = a / i;
- if(b % d == 0 and i != d) {
- res++;
- }
- }
- }
- cout << res << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement