POJ1004
来源:互联网 发布:销售业绩数据分析 编辑:程序博客网 时间:2024/06/07 15:04
Financial Management
Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 188265 Accepted: 71441
Description
Larry graduated this year and finally has a job. He's making a lot of money, but somehow never seems to have enough. Larry has decided that he needs to grab hold of his financial portfolio and solve his financing problems. The first step is to figure out what's been going on with his money. Larry has his bank account statements and wants to see how much money he has. Help Larry by writing a program to take his closing balance from each of the past twelve months and calculate his average account balance.
Input
The input will be twelve lines. Each line will contain the closing balance of his bank account for a particular month. Each number will be positive and displayed to the penny. No dollar sign will be included.
Output
The output will be a single number, the average (mean) of the closing balances for the twelve months. It will be rounded to the nearest penny, preceded immediately by a dollar sign, and followed by the end-of-line. There will be no other spaces or characters in the output.
Sample Input
100.00489.1212454.121234.10823.05109.205.271542.25839.1883.991295.011.75
Sample Output
$1581.42
Source
Mid-Atlantic 2001
超级大水题----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------超级大水题
import java.util.*;public class POJ1004 { public static void main(String [] args) { Scanner in=new Scanner(System.in); float sum=0; int i=12; while(i>0){ float a=in.nextFloat() ; sum+=a; i--; } System .out.printf("$%.2f",sum/12); }}
阅读全文
0 0
- POJ1004
- poj1004
- poj1004
- poj1004
- POJ1004
- POJ1004
- poj1004
- POJ1004
- poj1004
- POJ1004
- poj1004
- POJ1004
- POJ1004
- poj1004
- poj1004
- Poj1004
- poj1004
- poj1004
- smartbi学习记四之几个简单的设置
- Sqlserver常用函数例子说明
- Toolbar的简单使用
- log4j 初始化 initialize the log4j system properly
- C#中的 ref 传进出的到底是什么 解惑篇
- POJ1004
- jamvm的浅显认识
- 笔记1
- Android Studio调用百度地图
- python核心编程第12章习题
- Java实现简单的RPC框架
- fastJson过滤字段(深层次)
- 一些方便的LaTex在线编辑工具
- jQuery删除元素