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