Discuss / Java / 作业

作业

Topic source

Reason

#1 Created at ... [Delete] [Delete and Lock User]
Scanner sc = new Scanner(System.in);System.out.print("请输入上次考试的成绩: ");int pre = sc.nextInt();System.out.print("请输入本次考试的成绩: ");int now = sc.nextInt();String inf = now >= pre ? "提升" : "下降";System.out.printf("本次考试相较于上次考试%s了%.2f%%", inf, Math.abs((now-pre)) * 100.0 / pre);

  • 1

Reply