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