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