Advertisement
alex326

Untitled

Jan 28th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. problema 60
  2.  
  3. #include <iostream>
  4. using namespace std;
  5. int main()
  6. {
  7. int a,b,d=2,ok=0;
  8. cin>>a>>b;
  9. if (a>b){
  10. while (d*d<=a && ok==0){
  11. if (a%d==0 && b%d==0)
  12. ok=1;
  13. d++;
  14. }
  15. if (ok==0)
  16. cout<<"PIE";
  17. else
  18. cout<<"NOPIE";
  19. }
  20. if (b>a){
  21. while (d*d<=b && ok==0){
  22. if (b%d==0 && a%d==0)
  23. ok=1;
  24. d++;
  25. }
  26. if (ok==0)
  27. cout<<"PIE";
  28. else
  29. cout<<"NOPIE";
  30. }
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement