标签:ini pairs ++ man test osi scanf parent inpu
1 10 1 20 3 30 4 0 0
Case 1: 2 Case 2: 4 Case 3: 5
!细致审题
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
using namespace std;
int main()
{
int a,b,mod,n,m,t,number,ans;
scanf("%d",&t);
while(t--) {
number=0;
while(scanf("%d%d",&n,&m)!=EOF){
if(n==0 && m==0) break;
ans=0;
for(a=1;a<n;a++) {
for(b=a+1;b<n;b++) {
if((a*a+b*b+m)%(a*b)==0) ans++;
}
}
printf("Case %d: %d\n",++number,ans);
}
if(t) printf("\n");
}
return 0;
}HDU 1017 A Mathematical Curiosity (枚举水题)
标签:ini pairs ++ man test osi scanf parent inpu
原文地址:http://www.cnblogs.com/clnchanpin/p/7238972.html