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