提交时间:2023-11-12 10:24:03
运行 ID: 30948
#include <iostream> using namespace std; int main() { int i, n1, n2, n3, n4, n5, n; for (i = 0; i < 256; i++) { n = i * i; n5 = n / 10000; n4 = (n % 10000) / 1000; n3 = (n % 1000) / 100; n2 = (n % 100) / 10; n1 = (n % 10) / 1; if (n < 10) cout << i << endl; else if (n < 100 && n2 == n1) cout << i << endl; else if (n < 1000 && n3 == n1) cout << i << endl; else if (n < 10000 && n4 == n1 && n3 == n2) cout << i << endl; else if (n > 10000 && n5 == n1 && n4 == n2) cout << i << endl; } }