题解 | #二维数组操作#

二维数组操作

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;
}

全部评论

相关推荐

点赞 评论 收藏
分享
屌丝逆袭咸鱼计划:心态摆好,man,晚点找早点找到最后都是为了提升自己好进正职,努力提升自己才是最关键的😤难道说现在找不到找的太晚了就炸了可以鸡鸡了吗😤早实习晚实习不都是为了以后多积累,大四学长有的秋招进的也不妨碍有的春招进,人生就这样
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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