C++ 找出所有雷劈数:代码实现与算法解析
#include
int main() { for (int abcd = 1000; abcd <= 9999; abcd++) { int ab = abcd / 100; int cd = abcd % 100; if ((ab + cd) * (ab + cd) == abcd) { cout << abcd << endl; } } return 0; }
原文地址: https://www.cveoy.top/t/topic/qeIz 著作权归作者所有。请勿转载和采集!