#include"stdio.h"#include"math.h"intis_Square(int n){int i =(int)sqrt(n);if(i*i == n)return1;elsereturn0;}intmain(){int i;for(i=1;i<100000;i++){if(is_Square(i+100)&&is_Square(i+168))printf("%d\n",i);//156}return0;}
2. 用递归法将一个整数转换成字符串输出
#include"stdio.h"#include"math.h"voidchange(int i){int n = i /10;if(n !=0)change(n);putchar(i%10+'0');}intmain(){int i;printf("输入转换数值:");scanf("%d",&i);change(i);return0;}