4 solutions

  • 3
    @ 2023-10-29 15:01:17

    来个不同做法的:(求点赞)

    #include<iostream>
    #include<cmath>
    using namespace std;
    int main()
    {
     int x,y;
     cin>>x>>y;//输入
     //输出
     if(abs(y)+abs(x)>=2) cout<<"no";
     else cout<<"yes";
     return 0;//完结散花
    }
    
    • 2
      @ 2024-1-27 9:28:30
      #include<bits/stdc++.h>
      using namespace std;
      int x,y;
      int main(){
      	cin>>x>>y;
      	if(x>=-1&&x<=1&&y>=-1&&y<=1) cout<<"yes"<<endl;
      	else cout<<"no";
      	return 0;
      }
      
      • 1
        @ 2023-9-17 11:23:41
        #include <bits/stdc++.h>
        using namespace std;
        int a,b;
        int main(){
        	cin>>a>>b;
        	if((a>=-1&&a<=1)&&(b>=-1&&b<=1)) cout<<"yes";
        	else cout<<"no";
        }
        //简洁的代码,点个赞再走吧
        
        • 0
          @ 2023-9-23 18:37:46

          #include<bits/stdc++.h> using namespace std; int main(){ long long a,b; cin>>a>>b; if((a<=1&&a>=-1)&&(b<=1&&b>=-1)){ cout<<"yes"; }else{ cout<<"no"; } }

          • 1

          Information

          ID
          544
          Time
          1000ms
          Memory
          256MiB
          Difficulty
          1
          Tags
          # Submissions
          40
          Accepted
          35
          Uploaded By