40?请大佬赐教

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

@[风之殇](/user/314946) 比如10的时候,你照样会在前边输出一个0,就变成了010
by expnoi @ 2020-09-25 22:59:27


等等,我有个情况没考虑
by expnoi @ 2020-09-25 23:02:00


```cpp #include<iostream> #include<string> #include<cstdio> #include<cmath> #include<cstring> #include<algorithm> #include<iomanip> #include<cstdlib> #include<ctime> #include<cctype> using namespace std; int main() { int n,s1=1,s2=1; cin>>n; if(n==0) { return 0; } for(int i=1;i<=n;i++) { for(int j=1;j<=n;j++) { if(s1<10&&s1!=0) cout<<0<<s1++; else cout<<s1++; } cout<<endl; } cout<<endl; for(int i=1;i<=n;i++) { for(int z=2;z<=2*n-2*i+1;z++) { cout<<" "; } for(int j=1;j<=i;j++) { if(s2<10) cout<<0<<s2++; else cout<<s2++; } cout<<endl; } return 0; //前三个样例错了 } ``` 给你改了,好好参考
by expnoi @ 2020-09-25 23:06:40


@[风之殇](/user/314946)
by expnoi @ 2020-09-25 23:07:40


@[hts123456](/user/378346) 谢谢大佬,A了
by 风之殇 @ 2020-09-25 23:15:59


@[风之殇](/user/314946) 好的
by expnoi @ 2020-09-25 23:17:35


@[hts123456](/user/378346) Markdown我用的不熟练,刚刚在试
by 风之殇 @ 2020-09-25 23:18:08


@[风之殇](/user/314946) ??
by expnoi @ 2020-09-25 23:19:20


@[hts123456](/user/378346) 没啥
by 风之殇 @ 2020-09-25 23:22:11


@[风之殇](/user/314946) 。
by expnoi @ 2020-09-25 23:23:15


|