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