Introduction to Java Programming编程题3.22<判断点是否在矩形内>
来源:互联网 发布:php 读取文件过程 编辑:程序博客网 时间:2024/06/08 06:00
/*Enter a point with two coordinates: 2 7Point (2.0, 7.0) is not in the rectangle.Enter a point with two coordinates: 2 2Point (2.0, 2.0) is in the rectangle.*/import java.util.Scanner;public class PointInARectagle { public static void main(String[] args) { Scanner input = new Scanner(System.in); double x1 = 10 / 2, y1 = 5 / 2; System.out.print("Enter a point with two coordinates: "); double x2 = input.nextDouble(); double y2 = input.nextDouble(); if (x2 <= x1 && y2 <= y1) System.out.println("Point (" + x2 + ", " + y2 + ")" + " is in the rectangle."); else System.out.println("Point (" + x2 + ", " + y2 + ")" + " is not in the rectangle."); }}
0 0
- Introduction to Java Programming编程题3.22<判断点是否在矩形内>
- Introduction to Java Programming编程题3.22<判断点是否在圆内>
- Introduction to Java Programming编程题3.27<判断点是否在三角形内>
- 编程练习:判断点是否在矩形内
- Introduction to Java Programming编程题3.28<判断两个长方形是否相交>
- 判断点是否在矩形内
- 判断点是否在矩形内
- 判断点是否在矩形内
- 判断一个点是否在矩形内PtInRect
- 判断一个点是否在圆角矩形、椭圆形内
- 判断点是否在矩形内碰撞代码
- 计算几何----判断点是否在一个矩形内
- cocos2d-js判断点是否在矩形内
- Introduction to Java Programming编程题9.13<回文字符串(在命令行传字符串)>
- introduction to Java Programming 编程题5.3<回文整数>
- Introduction to Java Programming编程题5.6<打印数字三角形>
- Introduction to Java Programming编程题5.13<数列求和>
- Introduction to Java Programming编程题5.14<计算数列>
- java中使用akka手记三 cluster详例
- mysql 错误 SQL Error: 1366: Incorrect string value: "\xE8\xAF\xA6\xE7\xBB\x86…" for column "address"
- Nginx 反向代理、负载均衡、页面缓存、URL重写及读写分离详解
- IOS-笔记8(手势)
- Spring Side3的安全框架
- Introduction to Java Programming编程题3.22<判断点是否在矩形内>
- HashKey小测试
- MySQLDump在使用之前一定要想到的事情
- 深入浅出 RPC-(1)
- 关于时间戳和QDateTime相互转换的有关问题
- MySQL在创建索引之前一定要想到的事情
- opencv 皮肤检测 椭圆模型+轮廓去噪
- 输入url发生了什么
- 实现Rserve和php的通信