求平均数
?
import java.util.*; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); float sum = 0; for(int i = 0; i < 12; i++) sum += in.nextFloat(); System.out.printf("$%.2f\n", sum/12); } }