Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/loops/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Loops 程序逻辑问题 使用循环结构为一个程序设计逻辑,该程序输出从1到25的每个偶数及其平方和立方体_Loops_Logic - Fatal编程技术网

Loops 程序逻辑问题 使用循环结构为一个程序设计逻辑,该程序输出从1到25的每个偶数及其平方和立方体

Loops 程序逻辑问题 使用循环结构为一个程序设计逻辑,该程序输出从1到25的每个偶数及其平方和立方体,loops,logic,Loops,Logic,这是我的答案,我需要知道我是否在正确的轨道上,仅供参考,这是编程逻辑,而不是实际代码。我需要你的帮助谢谢 If n > 0> 25 MOD 2 = o then NMOD2 = 0 Else then NMOD2 = (0)^2 End If If NMOD2 = 0 then NMOD2 = (0)^3 嗯,像这样 for (int i = 1; i <= 25; i++) { if (i % 2 == 0) { cout <&l

这是我的答案,我需要知道我是否在正确的轨道上,仅供参考,这是编程逻辑,而不是实际代码。我需要你的帮助谢谢

If n > 0> 25 MOD 2 = o then
  NMOD2 = 0
Else then
  NMOD2 = (0)^2
End If

If NMOD2 = 0 then
  NMOD2 = (0)^3
嗯,像这样

for (int i = 1; i <= 25; i++) {
    if (i % 2 == 0) {
        cout << i << ' ' << i*i << ' ' << i*i*i << "\n\n";
    }
}
for(int i=1;i