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