题解 | #二维数组操作#

二维数组操作

http://www.nowcoder.com/practice/2f8c17bec47e416897ce4b9aa560b7f4

#include <bits/stdc++.h>
using namespace std;

int main(){
    int m,n,x,y;
    int x1,y1,x2,y2;
    int l,r;
    
    
    while(cin>>m>>n){
        //bool f=false;//无错误
        if(m<=9&&n<=9) cout<<0<<endl;
        else cout<<-1<<endl;
        
        cin>>x1>>y1>>x2>>y2;
        if(x1>=m||x2>=m||y1>=n||y2>=n) cout<<-1<<endl;
        else cout<<0<<endl;
       
        cin>>l;
        if(m==9||l>m-1) { 
            cout<<-1<<endl;
           // f=true;
         }else cout<<0<<endl;
        
        cin>>r;
        if(n==9||r>n-1) { 
            cout<<-1<<endl;
            //f=true;
         }else cout<<0<<endl;
         
         cin>>x>>y;
         if(x<m&&y<n) cout<<0<<endl;
         else cout<<-1<<endl;
    }
    return 0;
}

全部评论

相关推荐

求offer的大角牛:不吃香菜
点赞 评论 收藏
分享
小浪_Coding:找硬件测试,也可兼顾软测欧, 简历还可以的 ,注意排版,项目写的有条理一点, 然后个人技能多加点, 润色好简历之后就开始沟通海投了,深圳,东莞这边做硬件相关的公司还不少, 医疗类,仪器类的都可以尝试
点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
07-01 11:27
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务