ACM乐园
Love Me,Love My Code!
posts - 53,  comments - 24,  trackbacks - 0
http://acm.hdu.edu.cn/showproblem.php?pid=1017

大水题,不过要注意格式,贴代码:

#include <iostream>
#include 
<algorithm>

using namespace std;


int main()
{
    
int t,c,n,m,i,j,result;
    cin
>>t;
    
while(t--)
    
{
        c
=1;
        
while(cin>>n>>m,!(m==0 && n==0))
        
{
            result
=0;
            
for(i=1;i<n;i++)
                
for(j=i+1;j<n;j++)
                    
if((i*i+j*j+m)%(i*j)==0)
                    
{
                        result
++;
                    }

            cout
<<"Case "<<c<<""<<result<<endl;
            c
++;
        }

        
if(t)
            cout
<<endl;
    }

    
return 0;
}
posted on 2011-04-01 18:57 大大木马 阅读(217) 评论(0)  编辑 收藏 引用

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理



<2011年4月>
272829303112
3456789
10111213141516
17181920212223
24252627282930
1234567

常用链接

留言簿(1)

随笔档案(53)

文章档案(2)

搜索

  •  

积分与排名

  • 积分 - 62448
  • 排名 - 352

最新评论

阅读排行榜

评论排行榜