Advertisement
alex326

Untitled

Jan 22nd, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. problema 1574
  2.  
  3. #include <iostream>
  4. using namespace std;
  5. int main()
  6. {
  7. int a,b,d=1,s1=0,s2=0;
  8. cin>>a>>b;
  9. while (d<=a/2){
  10. if (a%d==0)
  11. s1=s1+d;
  12. d++;
  13. }
  14. d=1;
  15. while (d<=b/2){
  16. if (b%d==0)
  17. s2=s2+d;
  18. d++;
  19. }
  20. if (s1==b && s2==a)
  21. cout<<"PRIETENE";
  22. else
  23. cout<<"NU SUNT PRIETENE";
  24. return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement