Discuss / Java / 作业

作业

Topic source

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in); 

        System.out.print("上次成绩: ");

        double prve = scanner.nextDouble(); 

        System.out.print("本次成绩: "); 

        double thisTime = scanner.nextDouble(); 

double percent = 0.01;

        System.out.printf(" %.2f%%\n", (thisTime-prve)/prve/percent); 

    }

}


  • 1

Reply