Hdu_1017_a mathematical Curiosity (analog)

Source: Internet
Author: User
Original title Link: http://acm.hdu.edu.cn/showproblem.php?pid=1017
#include <iostream>using namespace Std;int main () {    int s;    Cin >> S;    while (s--)    {        int n,m;        int cnt = 1;        while (1)        {            cin >> n >> m;            int x = 0;            if (n = = 0 && m = = 0) break                ;            for (int i = 1;i <= n-2;i++)            {for                (int j = i+1;j <= n-1;j++)                {                    if ((i*i + j*j + m)% (i*j) = = 0) 
  {                        x + +;}}            }            cout << "Case" << cnt << ":" << x << "\ n";//Format ":" followed by a space             cnt++;        }        if (S > 0)//The last set of data does not require a blank line            cout << "\ n";    }    return 0;}

Hdu_1017_a mathematical Curiosity (analog)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.