题解 | #乘法表#
乘法表
https://www.nowcoder.com/practice/ff797e49df674c049021e8be2ab026e6
#include <iostream>
using namespace std;
#include <iomanip>
int main() {
int i, j;
for (i = 1; i <= 9; ++i)
{
for (j = 1; j <= i; ++j)
{
cout << j << "*" << i << "=";
cout << setw(2) << j * i << " ";
}
cout << endl;
}
}
// 64 位输出请用 printf("%lld")
setw(2)设置两位宽度。
C++题解 文章被收录于专栏
记录在牛客网用C++刷题的题解思路
