在3位整数100~999中查找符合如下条件的整数并在屏幕上输出,这个数既是完全平方数,又有两位数字相同
#include <stdio.h> int main(void) { int i,n,one,two,three,temp; for(i=100;i<1000;i++) { for(n=1;n<100;n++) { if(n*n != i) continue; one = i/100; temp = i - one*100; two = temp/10; three = temp - two*10; if(two != three && one != two && three != one) continue; printf("%d \n",i); } } return 0; }