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