题解
2026-04-19 16:46:10
发布于:广东
0阅读
0回复
0点赞
该题属于字符串类型二维数组输入输出。
范围通过 x2−x1+1 行和y2-y1+1的字符串得知。(即x1x2,y1y2)
#include<bits/stdc++.h>
using namespace std;
char a[105][105];
int main(){
int h,w;
scanf("%d%d",&h,&w);
int x,y,x1,y1;
scanf("%d%d%d%d",&x,&x1,&y,&y1);
for(int i=1;i<=h;i++){
for(int j=1;j<=w;j++){
cin>>a[i][j];
}
}
for(int i=x;i<=x1;i++){
for(int j=y;j<=y1;j++){
cout<<a[i][j];
}
cout<<endl;
}
return 0;
}//(变量可改为题目所述)
这里空空如也







有帮助,赞一个