Java語言編寫鍵盤輸入10個數?
public static void main(String [] args) {
Scanner sc = new Scanner(System.in);
int count =1;
int sum = 0;
int avg = 0;
while(count<11){
sum +=sc.nextInt();
count++;
}
//平均值
avg = sum/10;
}
Java語言編寫鍵盤輸入10個數?
public static void main(String [] args) {
Scanner sc = new Scanner(System.in);
int count =1;
int sum = 0;
int avg = 0;
while(count<11){
sum +=sc.nextInt();
count++;
}
//平均值
avg = sum/10;
}