Question 18: an integer (less than 100000). After 100 is added, it is a full number of workers, and 168 is a full number of workers. What is the maximum number?

Source: Internet
Author: User

/*************************************** ************************
* *** Auther: liuyongahui
* ***** Date:
* ** Language: C
**************************************** ***********************/
/*
Question 18: an integer (less than 100000). After 100 is added, it is a full number of workers, and 168 is a full number of workers. What is the maximum number?
*/

# Include <stdio. h>
# Include <math. h>
Int main ()
{
Int I;
Int n;
Int m;
Int l = 0;
Int a [100];

For (I = 1; I <100000; I ++)
{
N = sqrt (100 + I );
M = sqrt (168 + I );
If (n * n = 100 + I & m * m = 168 + I)
{
A [l ++] = I;
}
}

Printf ("this number has % d, they are as follows: \ n", l );
For (I = 0; I <l; I ++)
{
Printf ("% d \ n", a [I]);
}
Return 0;
}


 

Related Article

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.