测试没问题,为什么两个WA?
  • 板块B2083 画矩形
  • 楼主AlexDT
  • 当前回复3
  • 已保存回复3
  • 发布时间2024/1/7 12:13
  • 上次更新2024/1/7 14:57:43
查看原帖
测试没问题,为什么两个WA?
745934
AlexDT楼主2024/1/7 12:13

大佬求助!什么情况都试过了,还是有两个WA!

#include<bits/stdc++.h>
using namespace std;
int main(){
	int a,b,f;
	char c;
	cin>>a>>b>>c>>f;
	if(f){
		for(int i=1;i<=a;i++){
			for(int j=1;j<=b;j++){
				cout<<c;
			}
			cout<<endl;
		}
	}else{
		for(int i=1;i<=a;i++){
			for(int j=1;j<=b;j++){
				if(i==1||i==b||j==1||j==a){
					cout<<c;
				}else{
					cout<<" ";
				}
			}
			cout<<endl;
		}
	}
	return 0;
}
2024/1/7 12:13
加载中...