求助!!!各位大佬帮忙改一下,为什么全WA了???

P5725 【深基4.习8】求三角形

@[zps1122](/user/578842) 希丰展?用 md
by 8atemak1r @ 2022-03-13 20:59:00


希丰展?使Md
by ningago @ 2022-03-13 21:07:48


望丰展使Md
by BetaCutS @ 2022-03-13 21:08:29


```cpp #include <bits/stdc++.h> using namespace std; int n; int main() { cin >> n; for (int i = 1; i <= n*n; i++) { if (i < 10) { cout << "0" << i; } else { cout << i; } if (i % n == 0) cout << endl; } cout << endl; int temp = 1; for (int i = 1; i <= n; i++) { for (int j = 1; j <= (n - i)*2; j++) cout << " "; for (int k = 1; k <= i; k++) { if (temp < 10) cout << "0" << temp; else { cout << temp; } temp++; } if (i == n) break; cout << endl; } return 0; } ``` AC了,还帮你改好了Md
by BetaCutS @ 2022-03-13 21:10:55


你把n默认成4了,导致输出错误
by BetaCutS @ 2022-03-13 21:11:40


@[zps1122](/user/578842)
by BetaCutS @ 2022-03-13 21:11:49


初次用,不太会用,怎么搞呀[憨笑]
by zps1122 @ 2022-03-13 21:14:16


@[I_ak_NOI_and_IOI](/user/474577)
by zps1122 @ 2022-03-13 21:14:50


哦哦,题明白了,谢谢大佬 @[I_ak_NOI_and_IOI](/user/474577)
by zps1122 @ 2022-03-13 21:16:30


[Md说明](https://www.luogu.com.cn/blog/luogu/how-to-use-markdown)
by BetaCutS @ 2022-03-13 21:19:35


| 下一页