HDU 1017 A Mathematical Curiosity

数学问题,没难度

附代码

 1 #include <iostream>
 2 #include <cstdio>
 3 
 4 using namespace std;
 5 
 6 int main()
 7 {
 8     int N;
 9     scanf("%d",&N);
10     while(N--){
11         int n,m,a,b;
12         int num=0,i=0;
13         while(~scanf("%d%d",&n,&m)&&n){
14             num=0;
15             for(b=1;b<n;b++){
16                 for(a=1;a<b;a++){
17                     if((a*a+b*b+m)%(a*b) == 0)
18                     num++;
19                 }
20 
21             }
22 
23             printf("Case %d: %d
",++i,num);
24 
25         }
26         if(N != 0)
27             printf("
");
28     }
29     return 0;
30 }
---------------- 人们生成的最美好的岁月其实就是最痛苦的时候,只是事后回忆起来的时候才那么幸福。
原文地址:https://www.cnblogs.com/livelihao/p/5162958.html