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

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

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
int main(){ int i; double a,s; s=0; for(i=1;i<=12;i++) { scanf("%lf",&a); s+=a; } printf("$%.2lf\n",s/12); return 0;}

转载地址:http://fyvul.baihongyu.com/

你可能感兴趣的文章
js的prototype的详解(1)
查看>>
未来十年医疗健康这5个领域将最赚钱
查看>>
浅谈开源大数据平台的演变
查看>>
MySQL添加字段和修改字段的方法
查看>>
轨迹系列——通过时间及距离维度进行轨迹聚类平滑的一种方案
查看>>
项目管理(一)计时计件
查看>>
自定义控件中使用Render的writer
查看>>
36.2. rrdtool demo example
查看>>
BZOJ 2257: [Jsoi2009]瓶子和燃料【数论:裴蜀定理】
查看>>
JSP实现界面的自动跳转的几种方式
查看>>
android adb常用指令
查看>>
★如何解释特修斯之船问题?
查看>>
性能测试总结(三)--工具选型篇
查看>>
添加一条公告并标记为已读
查看>>
iOS - UIControl
查看>>
(转)现代C++函数式编程
查看>>
Android图表库MPAndroidChart(十三)——简约的底部柱状图
查看>>
[数分提高]2014-2015-2第1教学周第1次课
查看>>
(转) AdversarialNetsPapers
查看>>
精美后台系统模板
查看>>