标签:ide ble 保留 hide mat gif package http ack
题目大意:求出一年十二个月Larry平均每个月得到的利息
读入:12行每行一个浮点数
关于控制浮点数输出位数的资料:https://blog.csdn.net/hsliwei/article/details/6914774
1 package poj.ProblemSet; 2 3 import java.text.DecimalFormat; 4 import java.util.Scanner; 5 6 public class poj1004 { 7 public static void main(String[] args) { 8 Scanner cin=new Scanner(System.in); 9 double sum=0.0; 10 for (int i = 0; i < 12; i++) 11 sum+=cin.nextDouble(); 12 DecimalFormat ans = new DecimalFormat(".00"); 13 //.00表示保留的两位小数位 14 System.out.println("$"+ans.format(sum/12)); 15 } 16 }
Java-POJ1004-Financial Management
标签:ide ble 保留 hide mat gif package http ack
原文地址:https://www.cnblogs.com/JasonCow/p/12234401.html