这句话有什么问题吗?它总是输出0.0而不是总分结果
import java.util.Scanner;
public class d {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int num1;
int num2;
int num3;
int percentnum1;
int percentnum2;
int percentnum3;
double totalscore;
System.out.print("Enter paper 1 score (out of 90): ");
num1 = input.nextInt();
System.out.print("Enter paper 2 score (out of 90): ");
num2 = input.nextInt();
System.out.print("Enter IA score (out of 20): ");
num3 = input.nextInt();
percentnum1 = (num1 / 90) * 100;
percentnum2 = (num2 / 90) * 100;
percentnum3 = (num3 / 20) * 80;
totalscore = (percentnum1 * 0.4) + (percentnum2 * 0.4) + (percentnum3 * 0.2);
System.out.println("The total score is " + totalscore);
}
}
我是一名优秀的程序员,十分优秀!