题目大意:求出一年十二个月Larry平均每个月得到的利息

读入:12行每行一个浮点数

关于控制浮点数输出位数的资料:https://blog.csdn.net/hsliwei/article/details/6914774

 package poj.ProblemSet;

 import java.text.DecimalFormat;
import java.util.Scanner; public class poj1004 {
public static void main(String[] args) {
Scanner cin=new Scanner(System.in);
double sum=0.0;
for (int i = 0; i < 12; i++)
sum+=cin.nextDouble();
DecimalFormat ans = new DecimalFormat(".00");
//.00表示保留的两位小数位
System.out.println("$"+ans.format(sum/12));
}
}

Java-POJ1004-Financial Management的更多相关文章

  1. 练习英语ing——[POJ1004]Financial Management

    [POJ1004]Financial Management 试题描述 Larry graduated this year and finally has a job. He's making a lo ...

  2. POJ1004 Financial Management

    题目来源:http://poj.org/problem?id=1004 题目大意: Larry今年毕业并找到了工作.他开始赚很多的钱,然而他似乎总觉得不够.Larry决定好好掌控他的资产,解决他的财务 ...

  3. Financial Management[POJ1004]

    Financial Management Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 179458   Accepted: ...

  4. Java Business Process Management(业务流程管理) 初识环境搭建

    一.简介 (一)什么是jbpm JBPM,全称是Java Business Process Management(业务流程管理),它是覆盖了业务流程管理.工作流.服务协作等领域的一个开源的.灵活的.易 ...

  5. poj 1004:Financial Management(水题,求平均数)

    Financial Management Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 126087   Accepted: ...

  6. Financial Management 分类: POJ 2015-06-11 10:51 12人阅读 评论(0) 收藏

    Financial Management Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 164431   Accepted: ...

  7. Introduction to Financial Management

    Recently,i am learning some useful things about financial management by reading <Essentials of Co ...

  8. [POJ] #1004# Financial Management : 浮点数运算

    一. 题目 Financial Management Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 173910   Acc ...

  9. Financial Management

    Financial Management 时间限制:3000 ms  |  内存限制:65535 KB 难度:1   描述 Larry graduated this year and finally ...

  10. Financial Management POJ - 1004

    Financial Management POJ - 1004 解题思路:水题. #include <iostream> #include <cstdio> #include ...

随机推荐

  1. Html5学习系列

    Html5学习系列 HTML5 规定了一种通过 video 元素来包含视频的标准方法 Ogg = 带有 Theora 视频编码和 Vorbis 音频编码的 Ogg 文件 MPEG4 = 带有 H.26 ...

  2. Java(二)Arrays工具类

    Arrays是一个专门用于操作数组的工具类,该类位于java.util包中. Arrays的常用方法: 1.排序方法 原型:static void sort(int [] a) 功能:对指定的int型 ...

  3. 带你快速了解Linux文件系统

    http://www.embeddedlinux.org.cn/emb-linux/file-system/201807/03-8197.html 这篇教程将帮你快速了解 Linux 文件系统. 早在 ...

  4. 刷题22. Generate Parentheses

    一.题目说明 这个题目是22. Generate Parentheses,简单来说,输入一个数字n,输出n对匹配的小括号. 简单考虑了一下,n=0,输出"";n=1,输出" ...

  5. Golang 简单的读负责均衡

    read-loadbalance master-slave(n) 读库集群负载均衡器(简单轮询)+时间间隔错峰. github 地址:https://github.com/Plen-wang/read ...

  6. Ioc依赖注入:Unity4.0.1 在项目中的应用 (MVC和API)

    使用Unity的好处网上有很多,百度一下即可 这里引用了一篇关于面向接口编程的好处的文章作为引申:https://blog.csdn.net/Cyy19970527/article/details/8 ...

  7. tomcat-embeded-core源码编译

    使用spring-boot创建web工程时,默认采用embeded tomcat作为容器,实际使用过程中,可能会需要对其中的某些功能做微调,而tomcat又没有给出预留配 ,这时就需要对tomcat- ...

  8. Windows里面的虚拟机,部署的项目在同一网段也可以访问到

    一直想对自己Linux里面部署的项目进行再同一网段进行共享让其他和我同网段的人都看到 今天对于这个问题我终于解决了 首先编辑自己的虚拟机 进行虚拟机网络编辑 选择VMnet8 然后进行下面的NET设置 ...

  9. mybatis一级缓存和二级缓存(二)

    注意事项与示例配置 一级缓存 Mybatis对缓存提供支持,但是在没有配置的默认情况下,它只开启一级缓存,一级缓存只是相对于同一个SqlSession而言.所以在参数和SQL完全一样的情况下,我们使用 ...

  10. Appium+Python移动端(Android)自动化测试环境搭建

    一.安装JDK 下载好jdk安装包后直接下一步直至安装完成即可,安装完JDK后配置环境变量 :计算机→属性→高级系统设置→高级→环境变量: 系统变量→新建 JAVA_HOME 变量 变量值填写jdk的 ...