HDU 2104 hide handkerchief

#include<stdio.h>
#include
<stdlib.h>
int Gcd( int a,int b )
{
b
==0?a:Gcd( b,a%b );
}
int main()
{
int n,m;
while( scanf( "%d%d",&n,&m ),-1!=n&&-1!=m )
{
if( 1==Gcd( n,m ) )
printf(
"YES\n" );
else printf( "POOR Haha\n" );
}
return 0;
}

该题与HDU 1222 Wolf and Rabbit 意思一样的就是要你求有没有可能漏下来的数,如果Gcd()不等于1。

posted @ 2011-08-30 14:10  wutaoKeen  阅读(106)  评论(0编辑  收藏  举报