TQC+ JAVA103 計算平均值
import java.util.*;
public class JPA01 {
public static void main(String[] args){
System.out.println("Please input:");
Scanner keyboard =new Scanner(System.in);
double a,b,c,avg;
a=keyboard.nextDouble();
b=keyboard.nextDouble();
c=keyboard.nextDouble();
avg=(a+b+c)/3;
System.out.printf("Averge: %.2f",avg);
}
}
public class JPA01 {
public static void main(String[] args){
System.out.println("Please input:");
Scanner keyboard =new Scanner(System.in);
double a,b,c,avg;
a=keyboard.nextDouble();
b=keyboard.nextDouble();
c=keyboard.nextDouble();
avg=(a+b+c)/3;
System.out.printf("Averge: %.2f",avg);
}
}
沒有留言:
張貼留言