4 条题解
- 1
信息
- ID
- 158
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- 1
- 标签
- 递交数
- 172
- 已通过
- 119
- 上传者
#include<bits/stdc++.h>
using namespace std;
int main()
{
int x,y;
cin>>x>>y;
int a=abs(x);
int b=abs(y);
if (a<=1 && b<=1) cout<<"yes";
else cout<<"no";
return 0;
}
不难不难😄
#include<bits/stdc++.h>
using namespace std;
int main()
{
int x,y;
cin>>x>>y;
int a=abs(x);
int b=abs(y);
if (a<=1 && b<=1)
{
cout<<"yes";
}
else
{
cout<<"no";
}
return 0;
}
数学题就要从数学角度出发思考嘛!!
太简单了,随便写点题解:
在获取数据以后,只需要判断获取的x和y坐标是不是在1到-1之间就行
#include <iostream>
using namespace std;
int main()
{
int x1 = -1,x2 = 1,y1 = -1,y2 = 1,x3,y3;
cin >> x3 >> y3;
if ((x1 <= x3) && (x3 <= x2) && (y1 <= y3) && (y3 <= y2))
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;
}