【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;
}

 

posted @ 2013-08-12 19:36  为美好世界献上珂学  阅读(147)  评论(0)    收藏  举报