0分啊!!!为什么?
查看原帖
0分啊!!!为什么?
1311116
TGLXJ楼主2024/3/27 13:21

代码了如下:

#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。

2024/3/27 13:21
加载中...