竞赛
考级
耐高总冠军 张文杰
136****4819
#include <bits/stdc++.h> using namespace std; int main(){ int x,y; cin >> x >> y; if(x<=1 && x >=-1 && y<=1 && y>=-1){ cout << "yes"; }else{ cout << "no"; } return 0; }
😋🙀😡😤
#include <iostream> using namespace std; int main(){ int x,y,a=0; cin>>x>>y; switch(x){ case -1: case 0: case 1:a++;break; } switch(y){ case -1: case 0: case 1:a++;break; } if(a==2)cout<<"yes"; else cout<<"no"; return 0; }
姜凌溪—AK班->CC班专属
#include <iostream> using namespace std; int main(){ long long x,y; cin>>x>>y; if(x<=1 && x>=-1 && y<=1 && y>=-1){ cout<<"yes"; }else{ cout<<"no"; } return 0; }
刚出炉的面包
#include <iostream> using namespace std; int main(){ int x,y; cin >> x >> y; if(x >= -1 && x <= 1 && y <= 1 && y >= -1){ cout << "yes"; }else { cout << "no"; } return 0; }
ACOI
作者的话: 这道题对新手来说条件微微有点搞,不懂建议画图。 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 分析 > 题目:有一个正方形,四个角的坐标(x,y)分别是(1,-1),(1,1),(-1,-1),(-1,1),x是横轴,y是纵轴。写一个程序,判断一个给定的点是否在这个正方形内(包括正方形边界)。如果点在正方形内,则输出yes,否则输出no。 思路 我们可以画图解决。 这是一张草图,这个正方形就是题目里给出的正方形。一看我们就应该能理解条件了:如果要让点在正方形里,需要满足如下条件:x和y最小值都是-1,最大值都是1。换成C++的条件,就是x >= -1 && x <= 1 && y >= -1 && y <= 1。 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 代码 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 2024年10月07日 版本1
一只Merry
#include <bits/stdc++.h> using namespace std; int main(){ double x ,y; cin >> x >> y; if (abs(x) <= 1 && abs(y) <= 1) cout << "yes"; else cout << "no"; return 0; }
风中雪zLyXj
毛奕程
#include<bits/stdc++.h> using namespace std; int main(){ int a,b; cin>>a>>b; if (abs(a)==1&&abs(b)==1){ cout<<"yes"; }else if (abs(a)==1&&abs(b)==0){ cout<<"yes"; }else if (abs(a)0&&abs(b)1){ cout<<"yes"; }else if(a0&&b0){ cout<<"yes"; }else { cout<<"no"; } }
不会写代码
xy变量,大等于负一?小等于一?是是是,否是否
WA四十AC八十——八十!八十!
注意运算符优先级 优先级(priority)是一种约定,优先级高的先做,优先级低的后做。优先级是计算机分时操作系统在处理多个作业程序时,决定各个作业程序接受系统资源的优先等级的参数。
134 3697 5676(8)
啊?
回来看看
「欢愉」花火
正在减肥的吃货
逍遥骇好=&
#include<bits/stdc++.h> using namespace std; int main(){ int a,b; cin>>a>>b; if(a0&&b0){ cout<<"yes"; return 0; } if(a1&&b-1){ cout<<"yes"; } else if(a1&&b1){ cout<<"yes"; } else if(a==-1&&b==-1){ cout<<"yes"; } else if(a==-1&&b==1){ cout<<"yes"; } else{ cout<<"no"; } return 0; }
LS_YZY
zsy
有事找大号
共45条