import java.util.Scanner;
public class Solution1 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("Please input last time score: ");
int last = scanner.nextInt();
System.out.print("Please input this time score: ");
int now = scanner.nextInt();
double out = (double)(now - last)/last;
System.out.printf("小明提高的成绩百分比是 %.2f%%", 100*out);
}
Sign in to make a reply
夜游蛇
import java.util.Scanner;
public class Solution1 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("Please input last time score: ");
int last = scanner.nextInt();
System.out.print("Please input this time score: ");
int now = scanner.nextInt();
double out = (double)(now - last)/last;
System.out.printf("小明提高的成绩百分比是 %.2f%%", 100*out);
}
}