2011-12-16 13:17:13
地址:http://acm.hdu.edu.cn/showproblem.php?pid=2104
题意:丢手绢,其实和1222一样。
代码:
# include <stdio.h>
int gcd(int a, int b){return a%b?gcd(b,a%b):b;}
int main ()
{
int n, m ;
while (~scanf ("%d%d", &n, &m))
{
if (n==-1&&m==-1) break ;
puts (gcd(n,m) == 1 ? "YES" : "POOR Haha") ;
}
}