解题思路:
注意事项:
参考代码:
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner=new Scanner(System.in);
int month=12;
double sum=0;
for (int i=0;i<month;i++){
double d=scanner.nextDouble();
sum+=d;
}
double average=sum/month;
System.out.printf("$"+"%.2f",average);
}
}
0.0分
0 人评分