HDU1064 第一道JAVA

简单的不能再简单的题目, 不过倒是可以来练练新学的JAVA..

import java.util.Scanner;

public class Hello{

    public static void main(String[] args) {
// TODO Auto-generated method stub
double[] a;
double s = 0;
a = new double[13];
Scanner in = new Scanner(System.in);
for(int i = 0; i < 12; i++){
a[i] = in.nextDouble();
s += a[i];
}
s = (double)s/12;
System.out.printf("$%.2f", s);
System.out.println();
}
}
上一篇:Java核心技术卷一基础知识-第3章-Java的基本程序设计结构-读书笔记


下一篇:ASP.NET MVC 中@Html.Partial,@Html.Action,@Html.RenderPartial,@Html.RenderAction