2016年11月23日
摘要: /*回顾一下数学公式: 两点的坐标是(x1, y1)和(x2, y2) 则两点之间的距离公式为 d=√[(x1-x2)²+(y1-y2)²] 注意特例: 当x1=x2时 两点间距离为|y1-y2| 当y1=y2时 两点间距离为|x1-x2| 中点坐标:midpoint(X,Y) X=(X1+X2)/ 阅读全文
posted @ 2016-11-23 17:24 Heavy_dream 阅读(6266) 评论(0) 推荐(0) 编辑
摘要: //求最大公约数public class Parent { public int f(int a,int b){ if(a<b){//辗转相除是用大的除以小的。如果a<b,第一次相当a与b值交换 int temp=a; a=b; b=temp; } while(a%b!=0){ int temp=a 阅读全文
posted @ 2016-11-23 14:55 Heavy_dream 阅读(1070) 评论(0) 推荐(0) 编辑