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