【要求】
使用for循环打印乘法表
【源码】
[C++] 纯文本查看 复制代码 #include <iostream>
#include <iomanip>
using namespace std;
int main()
{
for (int i = 1; i < 10; i++) {
for (int j = 1; j < i + 1; j++)
cout << setw(2) << i << "*" << j << "=" << setw(2) << i * j;
cout << endl;
}
return 0;
}
【截图】
|