2025-03-06 22:46:33 +08:00

23 lines
515 B
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*-------------------------------------------------------
一个正整数加上100后是完全平方数加上268后还是一个完全平方数编程求出这样的数并输出在10000以内求
结果:
21
261
1581
-------------------------------------------------------*/
#include <stdio.h>
#include <math.h>
main()
{
int i,j,k;
for(i=1;i<=10000;i++)
{
/**********Program**********/
if(pow((int)sqrt(i+100), 2) == i+100 && pow((int)sqrt(i+268), 2) == i+268){
/********** End **********/
printf("%d\n",i);
}
}
}