【HDOJ】1017 A Mathematical Curiosity
【题目】 http://acm.hdu.edu.cn/showproblem.php?pid=1017
【报告】
水题,暴力过之。
BUT,这恶心死人的输入输出!!!
无力吐槽。直接交代码。
【程序】
// Task: 1017 A Mathematical Curiosity
#include
#include
using namespace std;
int main()
{
int
t,k;
cin >>
t;
k=0;
while
(t--)
{
int n,m;
k=0;
while (cin >> n >> m)
{
if (n==0&&m==0) break;
int ans=0;
for (int a=1;a
for (int b=a+1;b
if ((a*a+b*b+m)%(a*b)==0)
ans++;
cout << "Case " << ++k << ": " << ans
<< endl;
}
if (t>=1) cout << endl;
}
return
0;
}
为什么来到这,行将终结、匆忙纷扰、并且完全看不到救赎的世界。

浙公网安备 33010602011771号