`
fullfocus
  • 浏览: 100903 次
  • 来自: 厦门
最近访客 更多访客>>
社区版块
存档分类
最新评论

pku1004

阅读更多
java 代码
 
  1. import java.io.*;  
  2. import java.util.*;  
  3. import java.text.*;  
  4.   
  5. public class Pku1004 {  
  6.   
  7.     /** 
  8.      * @param args 
  9.      */  
  10.     public static void main(String[] args) {  
  11.         // TODO Auto-generated method stub  
  12.         Scanner cin = new Scanner(new BufferedInputStream(System.in));  
  13.         double output = 0;  
  14.         int i = 0;  
  15.         DecimalFormat f= new DecimalFormat("#.00");  
  16.         while(cin.hasNext()&&i<12)  
  17.         {  
  18.             output += cin.nextDouble();  
  19.             i++;  
  20.         }  
  21.   
  22.         System.out.println('$'+f.format(output/i));  
  23.     }  
  24.   
  25. }  
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics