HDOJ 1017

#include<stdio.h>
int main()
{
int n,m,k,z,i,j,x,ans;
scanf("%d",&k);
for (i=1;i<=k;i++)
{
if (i>1) printf("\n");
x=1;//大的输出块间有空行
while (scanf("%d%d",&n,&m))
{
if (n==0&&m==0) break;
printf("Case %d: ",x);
x++;
ans=0;
for (j=1;j<n-1;j++)
for (z=j+1;z<n;z++)
{
if ((j*j+z*z+m)%(j*z)==0) ans++;
}
printf("%d\n",ans);
}
}
}

 

 

 

 

 

 

 

每一个输出模块后有空行,you should output the sum of a and b, and followed by a blank line.
while(scanf("%d %d",&a, &b) != EOF) printf("%d\n\n",a+b);
输出结果之间有空行 you must note that there is a blank line between outputs.
if(T+1)
printf("%d\n\n",sum);
else
printf("%d\n",sum);


if(i<icase)
printf("%d\n\n",sum);
else
printf("%d\n",sum);

 

posted @ 2012-04-17 09:43  加拿大小哥哥  阅读(251)  评论(0编辑  收藏  举报