HDUOJ A Mathematical Curiosity 1017
此题不难就是输出格式麻烦
#include<stdio.h>
int main(){
int T;
scanf("%d",&T);
while(T--)
{
int n,m,num=0;
while(scanf("%d %d",&n,&m)&&n!=0)
{
int a,b,sum=0;
for(a=1;a<100;++a)
for(b=a+1;b<n;++b)
{
if((a*a+b*b+m)%(a*b)==0) sum++;
}
printf("Case %d: %d\n",++num,sum);
}
if(T) printf("\n");
}
}
posted on 2017-08-05 21:42 gavanwanggw 阅读(97) 评论(0) 编辑 收藏 举报