Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
324362 | 丁虞轩 | 【C3-T】九九乘法表 | C++ | 通过 | 100 | 2 MS | 256 KB | 463 | 2025-05-27 20:26:46 |
#include <iostream> #include <iomanip> // 用于格式化输出 using namespace std; int main() { int n; cin >> n; cout<<setw(3)<<"*"; for(int j=1;j<=n;j++){ cout<<setw(3)<<j; } for (int i = 1; i <= n; ++i) { if(i==1)cout <<endl<< setw(3) << i ; else cout<<setw(3)<<i; for (int j = 1; j <= n; ++j) { if(j<=i)cout << setw(3) << i * j; } cout << endl; } return 0; }