第一列包含数字 1 到 5 后续列包含乘以数字的结果 第一列数字 0 到 9
好的,我已经走到这一步了,但它不起作用,我不知道为什么!如果您能指出正确的方向,那将非常有帮助:)
#include <iostream>
using namespace std;
int main()
{
for ( int i=0 ; i < 5; i++)
{
cout << " ";
// end for
for ( int j = 0; j>=i; j ++)
cout << endl;
} // end for
return 0;
} //end of main function
最佳答案
The first column contains the numbers 1 through 5 Subsequent columns contain the result of multiplying the number in the First column by the numbers 0 through 9
嗯..
- 在您的代码段中,外循环从 0 到 4。但问题是从 1 到 5。
- 内循环应该从 0 到 9 运行,这意味着它独立于外循环的
i
值。所以,内循环的条件j>=i
是错误的。
关于C++编程帮助!它不会工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5462317/