HDU 1017A Mathematical Curiosity 水题 WA了6次

 1 #include<stdio.h>
2 int main()
3 {
4 int n,m,i,j,count,k,t,g;
5 scanf("%d", &t) ;
6 for(g = 1 ; g <= t ; g++)
7 {
8 if(g!=1)
9 puts("");
10 k = 0;
11 while(scanf("%d%d",&n,&m),n||m)//这里居然是|| WA了好几次。。
12 {
13 k++;
14 count = 0;
15 for(i = 1 ; i < n ; i++)
16 for(j = i+1 ; j < n ; j++)
17 if(((i*i+j*j+m)%(i*j)) == 0)
18 count++;
19
20 printf("Case %d: %d\n",k,count);
21 }
22 }
23 return 0;
24 }
原文地址:https://www.cnblogs.com/shangyu/p/2365778.html