[恢]hdu 2104

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") ;
}
}



posted @ 2012-01-06 17:39  Seraph2012  阅读(120)  评论(0编辑  收藏  举报