0分,求助!

B2083 画矩形

F=0的情况下,做错了
by Father_888 @ 2022-06-11 21:33:52


只输了底部和上面,没有输两边的
by Father_888 @ 2022-06-11 21:34:19


@[Father_888](/user/673221) 改了一下,80分 ```cpp #include<iostream> using namespace std; int main(){ int a,b,f; char c; cin>>a>>b>>c>>f; if(f==1) { for(int i=0;i<a;i++) { for(int j=0;j<b;j++) cout<<c; cout<<endl; } } else { for(int i=0;i<a;i++) { if(i==0||i==a-1) for(int j=0;j<b;j++) cout<<c; else { cout<<c; for(int j=0;j<b-2;j++) cout<<" "; cout<<c; } cout<<endl; } } return 0; } ```
by banglee @ 2022-06-11 21:36:40


@[banglee](/user/681292) 吧f==1改为f!=0,f不仅是1与0
by wenlebo @ 2022-06-11 21:56:28


@[wenlebo](/user/640552) 谢谢,改对了
by banglee @ 2022-06-11 22:04:19


|