#include <stdio.h> #include <math.h> int search(int n); int main() { int number; scanf("%d", &number); printf("count=%d\n", search(number)); system("pause"); return 0; } /* 你的代码将被嵌在这里 */ int search(int n) { int count = 0; int a1, a2, a3; for (int i = 11; i*i < n; i++) { a1 = i * i % 10; a2 = i * i / 10 % 10; a3 = i * i / 100; if (a1 == a2 || a1 == a3 || a2 == a3) count++; } return count; }