码迷,mamicode.com
首页 > 移动开发 > 详细

HDUOJ A Mathematical Curiosity 1017

时间:2017-08-05 22:55:29      阅读:217      评论:0      收藏:0      [点我收藏+]

标签:==   sum   不难   ase   top   ios   ack   post   article   



此题不难就是输出格式麻烦

#include<stdio.h> 
int main(){   
    int T; 
 scanf("%d",&T);
    while(T--) 
    { 
    int n,m,num=0;
    while(scanf("%d %d",&n,&m)&&n!=0)
    {        
        int a,b,sum=0; 
        for(a=1;a<100;++a)
        for(b=a+1;b<n;++b)
  { 
            if((a*a+b*b+m)%(a*b)==0) sum++; 
        } 
    printf("Case %d: %d\n",++num,sum); 
    }   
    if(T) printf("\n");
    } 

HDUOJ A Mathematical Curiosity 1017

标签:==   sum   不难   ase   top   ios   ack   post   article   

原文地址:http://www.cnblogs.com/gccbuaa/p/7291634.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!