您的位置:首页 > 其它

HDU 1017

2016-05-16 09:46 351 查看
题目:HDU1017 A Mathmatical Curiosity

题目分析:水题。重点是输入输出格式。

#include<stdio.h>
#include<string.h>
#include<iostream>
using namespace std;

int main()
{
int n,m,N;

scanf("%d",&N);
while(N--){
int Case=0;

while (scanf("%d%d",&n,&m),n||m)
{

int Count =0;
int a=0,b=0;
int temp=0;
for( b=2;b<n;++b)
for( a=1;a<n;++a){
temp=(a*a+b*b+m)%(a*b);
if( temp== 0 && a<b) Count++;
}

Case++;
cout<<"Case "<<Case<<":"<<" "<<Count<<endl;
}
if(N) cout<<endl;
}

return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: