#include <iostream> using namespace std; int main() { // 遍历所有四位数 for (int i = 1000; i <= 9999; i++) { // 拆分数字 int ab = i / 100; int cd = i % 100; // 验证是否为雷劈数 if ((ab + cd) * (ab + cd) == i) { cout << i << endl; } } return 0; } /************************************************************** Problem: 1085 User: linmiaoling Language: C++ Result: Accepted Time:18 ms Memory:2072 kb ****************************************************************/