acgo题库
  • 首页
  • 题库
  • 学习
  • 天梯
  • 备赛

    竞赛

    • CSP-J/S
    • 蓝桥杯

    考级

    • GESP
    • CPA
    • 电子学会考级
  • 资讯
  • 竞赛
  • 讨论
  • 团队
  • 商城
登录
注册
题目详情提交记录(0)
  • 题解(字符类型二维数组)

    字符类型二维数组输入输出

    userId_undefined
    Potato
    贪心·贪心尝试者快乐小狗GESP5级
    123阅读
    0回复
    4点赞
  • 题解

    该题属于字符串类型二维数组输入输出。 范围通过 x2−x1+1 行和y2-y1+1的字符串得知。(即x1x2,y1y2)

    userId_undefined
    雷碧
    时空双修者出道萌新快排信徒→排序之神造物者俄罗斯套娃大师位操作忍者
    36阅读
    0回复
    1点赞
  • 题解

    #include<bits/stdc++.h> using namespace std; char mp[1005][1005]; int main(){ int n,m; cin>>n>>m; int x1,yy1,x2,y2; cin>>x1>>x2>>yy1>>y2; for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++){ cin>>mp[i][j]; } } for(int i=x1;i<=x2;i++){ for(int j=yy1;j<=y2;j++){ cout<<mp[i][j]; } cout<<endl; } } ** **

    userId_undefined
    好玩吗
    出道萌新时间刺客
    17阅读
    0回复
    1点赞
  • G15|GESP.A62071题解

    二维字符写法: 代码如下:

    userId_undefined
    编程猪 AkiraG
    倔强青铜
    9阅读
    0回复
    0点赞
  • 包过的,轻松AC

    #include<bits/stdc++.h> using namespace std; char c[110][110]; int main(){ int h,w,x1,x2,y1,y2; cin>>h>>w>>x1>>x2>>y1>>y2; for(int i=1;i<=h;i++){ for(int j=1;j<=w;j++){ cin>>c[i][j]; } } for(int i=1;i<=h;i++){ bool f=false; for(int j=1;j<=w;j++){ if(i>=x1 && i<=x2 && j>=y1 && j<=y2){ cout<<c[i][j]; f=true; } } if(f){ cout<<endl; } } return 0; }

    userId_undefined
    我没有
    倔强青铜空间掌握者字符串·魔法使维度操控者冒泡宗师→排序元老造物者
    0阅读
    0回复
    0点赞
暂无数据

提交答案之后,这里将显示提交结果~

首页