[恢]hdu 1014

2011-12-20 13:17:01

地址:http://acm.hdu.edu.cn/showproblem.php?pid=1014

题意:其实就是求两个数是否互素。是则为Good,否则为Bad。

PE了2次。每组后面都有空行,数字10列,和字母之间是4个空格(开始写成5个)。

代码:

# include <stdio.h>


int gcd(int a, int b){return a%b?gcd(b,a%b):b;}
int main ()
{
char tab[2][15] = {"Bad Choice", "Good Choice"} ;
int a, b ;
while (~scanf ("%d%d", &a, &b))
{
printf ("%10d%10d %s\n\n", a, b, tab[gcd(a,b)==1]) ;
}
return 0 ;
}



posted @ 2012-01-06 23:06  Seraph2012  阅读(424)  评论(0)    收藏  举报