Poj1004

import java.util.Scanner;


public class Main {

	public static void main(String[] args) {
		
		Scanner scan = new Scanner(System.in);
		double sum = 0,acount;
		for(int i=0;i<12;i++){
			acount = scan.nextDouble();
			if(acount<0){
				return;
			}
			sum = sum+acount;
		}
		System.out.println("$"+String.format("%.2f", sum/12));
	}

}

你可能感兴趣的:(Poj1004)