原问题是杭电oJ一题http://acm.hdu.edu.cn/game/entry/problem/show.php?chapterid=1§ionid=2&problemid=6
其实就是判断这两个数是不是互质
#include<iostream>
#include<math.h>
using namespace std;
int gcd(int a,int b)
{
return b==0?a:gcd(b,a%b);
}
int main()
{
int mm,nn;
cin>>mm>>nn;int r;
while(!(mm==-1&&nn==-1))
{
if(gcd(mm,nn)==1)
cout<<"YES"<<endl;
else
cout<<"POOR Haha"<<endl;
cin>>mm>>nn;
}
return 0;
}