作业 完成
Topic sourcepackage com.itranswarp.learnjava;
import java.util.Scanner;
/**
* 输入上次考试成绩(int)和本次考试成绩(int),然后输出成绩提高的百分比,保留两位小数位(例如,21.75%)
*/
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("输入上次考试成绩:");
int prev = sc.nextInt();
System.out.println("本次考试成绩:");
int score = sc.nextInt();
double percent = (float)(score-prev)/prev*100;
System.out.printf("成绩提高了%.2f%%",percent);
sc.close();
}
}
- 1
求女票上微博
提高的 百分比 是 除以 之前本身 应该 就是对的