话说我语言选择的是C++20,不过从C++14到C++20我都试过了,也没什么用处,求助求助
by thesleepingflower @ 2024-02-15 17:05:16
@[thesleepingflower](/user/1184097)
你为什么要两个换行,你个就行,改了之后已AC
by S08577 @ 2024-02-15 17:10:00
@[S08577](/user/950923) 一个
by S08577 @ 2024-02-15 17:10:20
@[thesleepingflower](/user/1184097)
```cpp
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main()
{
int n, c = 1;
cin >> n;
for (int i = 0; i < n; i++)
{
for (int j = 0; j < n; j++)
{
printf("%02d", c++);
}
cout << endl;
}
cout<<endl; //改为一个换行
c = 1;
for (int i = 0; i < n; i++)
{
for (int k = 0; k < n - i - 1; k++)
cout << " ";
for (int j = 0; j < i + 1; j++)
{
printf("%02d", c++);
}
cout << endl;
}
return 0;
}
```
by hexuchen @ 2024-02-15 17:12:13
@[thesleepingflower](/user/1184097) 因为你上面的一个for循环已经加了一个换行了
by hexuchen @ 2024-02-15 17:12:40
@[S08577](/user/950923) 原来是这样,谢谢大哥,太感谢了
by thesleepingflower @ 2024-02-15 17:28:17
@[hexuchen](/user/945742) 好的好的,太感谢了,谢谢你!
by thesleepingflower @ 2024-02-15 17:28:50