题目内容
例3-4(书上)#include using namespace std;//判断n是否为回文数bool symm(unsigned n) { unsigned i = n; unsigned m = 0; while (i > 0) { m = m * 10 + i % 10; i /= 10; } return m == n;}int main() { for (unsigned m = 11; m < 1000; m++) if (symm(m) && symm(m * m) && symm(m * m * m)) { cout << "m = " << m; cout << " m * m = " << m * m; cout << " m * m * m = " << m * m * m << endl; } return 0;}试问:(1)在symm()函数中,当输入参数为523时,while循环体内容执行( )次;(2)在symm()函数中,当输入参数为1523时,while循环体内容执行( )次;
查看答案
搜索结果不匹配?点我反馈
更多问题