解题思路:
注意事项:
参考代码:
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int[] n=new int[2]; int[] c=new int[2]; for (int i = 0; i < n.length; i++) { n[i]=scanner.nextInt(); } for (int i = 0; i < c.length; i++) { c[i]=scanner.nextInt(); } if (n[0]==c[0]) { System.out.println("INF"); }else { System.out.println((c[1]-n[1])/(c[0]-n[0])); } } }
0.0分
2 人评分
杨陈 2021-04-13 19:31:22 |
坐标还有小数点的???