HDU 1064.Financial Management【超级无敌大水题】【9月1】
2015-09-01 13:29
351 查看
Financial Management
Problem 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
Sample Output
看代码:
Problem 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.00 489.12 12454.12 1234.10 823.05 109.20 5.27 1542.25 839.18 83.99 1295.01 1.75
Sample Output
$1581.42
看代码:
#include<cstdio> int main(){ double sum=0,a; for(int i=0;i<12;i++){ scanf("%lf",&a); sum+=a; } printf("$%.2f\n",sum/12); return 0; }
相关文章推荐
- 传输数据超长时,服务器未响应
- LeetCode 4 Median of Two Sorted Arrays 查找中位数,排除法,问题拓展 难度:1
- 【LeetCode】Sort Colors
- Celery 实现分布式任务队列
- linux下用java实现ftp上传、下载文件
- 浅谈机器学习的职业发展方向
- Java引用类型(强引用、弱引用、软引用、幽灵引用)
- Failed resolution of: Lcom/lion/ccpay/R$style;
- android子线程中弹出Toast
- [科普文] 网络流量劫持危害有多大?继续解密黑客巧妙神奇的“离线”入侵手段 (二)
- linux中fork()函数详解
- 常用的C语言编程工具
- 0-1背包
- 应用部署到JBOSS上遇到的问题
- Java常用的设计模式03:常用设计模式之单例模式(创建型模式)
- 黑马程序员之集合框架2
- 设计模式总结(备忘录)
- linux下用rpm 安装jdk 7的jdk-7u79-linux-x64.rpm
- Jsp分页实例---假分页
- 《漫画数学》的反思