首页 > 其他 > 详细

hdu1017

时间:2015-05-08 20:09:37      阅读:223      评论:0      收藏:0      [点我收藏+]

http://acm.hdu.edu.cn/showproblem.php?pid=1017

 1 #include<iostream>
 2 #include<stdio.h>
 3 #include<math.h>
 4 #include<string.h>
 5 #include<iostream>
 6 using namespace std;
 7 int main()
 8 {
 9     //freopen("in.txt","r",stdin);
10     int t;
11     scanf("%d",&t);
12     while(t--)
13     {
14         int Case=1;
15         int n,m;
16         while(1)
17         {
18             cin>>n>>m;
19             int count=0;
20             if(!n&&!m)
21             break;
22             for(int a=1;a<n;a++)
23             {
24                 for(int b=a+1;b<n;b++)
25                 {
26                     if((a*a+b*b+m)%(a*b)==0)
27                     count++;
28                 }
29             }
30             printf("Case %d: %d\n",Case++,count);
31         }
32         if(t!=0)
33         printf("\n");
34     }
35     return 0;
36 }

 

hdu1017

原文:http://www.cnblogs.com/xuesen1995/p/4488653.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!