社区讨论
0分啊!!!为什么?
B3751 [信息与未来 2019] 粉刷矩形参与者 2已保存回复 1
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 1 条
- 当前快照
- 1 份
- 快照标识符
- @lu9cz46z
- 此快照首次捕获于
- 2024/03/27 13:21 2 年前
- 此快照最后确认于
- 2024/03/27 16:53 2 年前
代码了如下:
CPP#include<bits/stdc++.h>
using namespace std;
int main(){
int n,m,k;
cin>>n>>m>>k;
char t[n+1][m+1];
for(int i=1;i<=n;i++){
for(int j=1;j<=m;j++){
t[i][j]='.';
}
}
int a,b;
char c,d;
for(int i=0;i<k;i++){
cin>>a>>b>>c>>d;
if(d=='R'){
for(int j=b;j<=m;j++){
t[a][j]=c;
}
}else if(d=='U'){
for(int j=a;j<=n;j++){
t[j][b]=c;
}
}else if(d=='L'){
for(int j=b;j>0;j--){
t[a][j]=c;
}
}else if(d=='D'){
for(int j=a;j>0;j--){
t[j][b]=c;
}
}
}
for(int i=1;i<=n;i++){
for(int j=1;j<=m;j++){
cout<<t[i][j];
}
cout<<endl;
}
return 0;
}
都是WA啊!!!QWQ。
回复
共 1 条回复,欢迎继续交流。
正在加载回复...