为什么只有80分啊! (纯暴力解法)

B2083 画矩形

```cpp #include<bits/stdc++.h> using namespace std; int main(){ int a,b,f; char c; cin>>a>>b>>c>>f; //看数据3<=a,5<=b /*if(a<2&&b<2){//1*1 cout<<c; return 0; } if(a==1){ for(int k=1;k<=b;k++){ cout<<c; } return 0; } if(b==1){ for(int k=1;k<=a;k++){ cout<<c<<endl; } return 0; } */ for(int i=1;i<=a;i++){ for(int j=1;j<=b;j++){ if(f!=0){ cout<<c; if(j%b==0){ cout<<endl; } }else{ for(int k=1;k<=b;k++){ cout<<c; } cout<<endl; for(int l=1;l<=a-2;l++){ cout<<c; for(int g=1;g<=b-2;g++){ cout<<" "; } cout<<c<<endl; } for(int t=1;t<=b;t++){ cout<<c; } return 0; } } } return 0; } ``` 下次多测几组特殊的用例(a不等于b) 别样例过了就交
by yichengjin @ 2024-02-02 17:37:58


@[yichengjin](/user/1002629) 感谢感谢!
by Water_Bucket @ 2024-02-03 08:59:45


|