博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
POJ 1004 Financial Management
阅读量:4560 次
发布时间:2019-06-08

本文共 1526 字,大约阅读时间需要 5 分钟。

Time Limit: 1000MS   Memory Limit: 10000K
Total Submissions: 195644   Accepted: 74335

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

#include
#include
#include
#include
using namespace std;double a,sum;int main(){ for(int i=1;i<=12;i++){ cin>>a;sum+=a; } printf("$%.2lf",sum/12);}

 

转载于:https://www.cnblogs.com/cangT-Tlan/p/9246193.html

你可能感兴趣的文章
php手册总结《安装与配置》
查看>>
PAT-乙级-1001. 害死人不偿命的(3n+1)猜想 (15)
查看>>
git安装及使用
查看>>
mysql一个非常实用解决sql查询优化的函数explain
查看>>
图文讲解NTFS和FAT32硬盘下 asp.net 生成word 错误: 80070005 和 错误:8000401a 的解决方法...
查看>>
《学习》5连接查询(高级查询)
查看>>
python日常—爬取豆瓣250条电影记录
查看>>
11.3NOIP模拟赛
查看>>
1.SDL介绍
查看>>
【重要更新】语言转换类编程工具Tangible系列本月又更新了!
查看>>
现场赛:开关灯问题
查看>>
codeforces A. Jeff and Rounding (数学公式+贪心)
查看>>
zoj 3462
查看>>
java多线程-信号量
查看>>
如何在Delphi XE2中使用Dynamic Web TWAIN
查看>>
js自定义实用函数总结
查看>>
java内存区域与内存溢出异常
查看>>
点点滴滴的成长[2011-11-1]:理解C#修饰符
查看>>
csrf(跨站请求伪造)
查看>>
高性能MySQL笔记-第1章MySQL Architecture and History-001
查看>>