1004
来源:互联网 发布:日在校园 知乎 编辑:程序博客网 时间:2024/05/17 06:16
Financial Management
Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 182547 Accepted: 68942
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
#include<iostream> #include<iomanip> using namespace std; int main(void) { double sum=0.0; for(int i=1;i<=12;i++) { double temp; cin>>temp; sum+=temp; } cout<<fixed<<setprecision(2)<<'$'<<sum/12.0<<endl; return 0; }
0 0
- [1004]
- 1004
- 1004
- 1004
- 1004
- 1004
- 1004
- 1004
- 1004
- 1004
- 1004
- 1004
- 1004
- 1004
- 1004
- 1004
- 1004
- 1004
- 生活小程序摩拜单车为啥投开锁功能?生活小程序是趋势?
- Ajax异步交互与php请求响应的实现
- 成就中国成就中国人的三种能力
- Flink-CEP之模式流与运算符
- TCP三次握手四次挥手
- 1004
- 安卓开发实例(4)储存信息、读取信息
- oracle的sequence增长设置
- 辞职转行的第一天
- Python爬虫之模拟登陆
- Linux I2C设备驱动编写(二)
- 相亲虐狗季,再谈女子无才便是“得”
- centos7 添加xfs硬盘
- ~稀疏矩阵的压缩存储与转置~