Discuss / Java / 正解

正解

Topic source

王旭

#1 Created at ... [Delete] [Delete and Lock User]
import java.util.Scanner;
public class JavaIO {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);        
        System.out.println("Please enter your last math score:");        
        int score = sc.nextInt();        
        System.out.println("Please enter your latest math score:");        
        int score1 = sc.nextInt();        
        System.out.printf("Your math score has improved by %.2f%% compared to the last time.",(float) (score1-score)/score*100);    
    }
}

  • 1

Reply