代码
#include<bits/stdc++.h>
using namespace std;
void f(int b,char x,int c) {
if(c==0) {
cout<<x;
for(int i=2; i<b; i++)cout<<" ";
cout<<x<<endl;
return;
}
for(int i=1; i<=b; i++) {
cout<<x;
}
cout<<endl;
return;
}
int main() {
int a,b;
cin>>b>>a;
int c;
char x;
cin>>x>>c;
for(int i=1; i<a; i++) {
if(i==1) {
for(int i=1; i<=b; i++) {
cout<<x;
}
cout<<endl;
continue;
}
f(b,x,c);
}
for(int i=1; i<=b; i++) {
cout<<x;
}
return 0;
}
样例——————对了。
自创样例(10 10 $ 1)——————对了。。。
一提交
[https://www.luogu.com.cn/record/125481461]()
仰天长啸————————————啊!!!
我究竟错在何处?
望请大佬帮忙
谢谢~~~