C++-判断-点和正方形的关系(区分边上和边内,界内、界外和界上)
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
Background
Description
C++-判断-点和正方形的关系(区分边上和边内,界内、界外和界上)
有一个正方形,四个角的坐标(x,y)分别是(1,-1),(1,1),(-1,-1),(-1,1),x是横轴,y是纵轴。写一个程序,判断一个给定的点是否在这个正方形内(包括正方形边界)。如果点在正方形内(界内),则输出1;如果点在正方形边上(界上),则输出2;如果点在正方形外(界外),则输出3。
Format
Input
Output
Samples
1
1
2
0
0
1
0
2
3
Limitation
1s, 1024KiB for each test case.
C++基础知识01(输入输出、变量类型、判断)
- Status
- Done
- Rule
- ACM/ICPC
- Problem
- 11
- Start at
- 2024-5-5 0:00
- End at
- 2024-5-20 0:00
- Duration
- 360 hour(s)
- Host
- Partic.
- 52