解题思路:
注意事项:
参考代码:
#include<stdio.h>
int f(int n);
int main()
{
int i;
for(i=1000;i<=9999;i++)
if(f(i)) printf("%d ",i);
return 0;
}
int f(int n)
{
int tem,t;
tem=n/100;
t=n%100;
if((tem+t)*(tem+t)==n) return 1;
else return 0;
}
0.0分
0 人评分
C语言程序设计教程(第三版)课后习题8.1 (C语言代码)浏览:612 |
数列排序 (C语言代码)浏览:728 |
九宫重排 (C++代码)浏览:1062 |
【绝对值排序】 (C语言代码)浏览:515 |
【绝对值排序】 (C++代码)浏览:393 |
【C语言训练】大、小写问题 (C语言代码)浏览:583 |
C语言程序设计教程(第三版)课后习题7.2 (C语言代码)浏览:717 |
C语言程序设计教程(第三版)课后习题6.9 (C语言代码)浏览:328 |
回文数字 (C语言代码)浏览:2013 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:555 |