1004 Financial Management
来源:互联网 发布:网络连接错误代码720 编辑:程序博客网 时间:2024/05/21 08:54
Financial Management
Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 132186 Accepted: 57053
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
C++代码如下:
#include<iostream>using namespace std;int main(){double money[12];int i;double total = 0;for(i=0;i<12;i++){cin>>money[i];total += money[i];}cout<<"$"<<total/12<<endl;return 0;}
总结:
在输入时即统计总和,最后直接/12输出平均值,节省时间,提高效率。
0 0
- PKU 1004 Financial Management
- ACM 1004--Financial Management
- 1004Financial Management
- 1004 Financial Management
- pku 1004 Financial Management
- 1004 Financial Management
- 【POJ】1004 Financial Management
- POJ-1004:Financial Management
- POJ 1004 Financial Management
- POJ 1004 Financial Management
- [POJ]1004 Financial Management
- POJ 1004 Financial Management
- poj 1004 Financial Management
- poj 1004 Financial Management
- 1004 Financial Management
- 1004 Financial Management
- POJ-1004-Financial Management
- poj 1004 Financial Management
- jsonp原理
- 第十七篇 EPON注册过程
- 从头到尾彻底理解KMP
- 数据加密和数据签名的本质区别 解释
- 自学编程的——“3遍读书法”
- 1004 Financial Management
- 自定义Launcher设为默认应用
- Mac下获取Cocos Studio中的UI
- centos6.5安装wine
- Linux如何卸载挂载文件
- 《一块都不能倒》小清新风格的经典叠楼房游戏
- PythonOpenCV:MLP用于最近邻搜索
- 字符编码
- window.open各参数以及window.各种事件