Financial Management
Time Limit: 1000MS   Memory Limit: 10000K
Total Submissions: 165062   Accepted: 61316

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 <iostream>
using namespace std;
int main()
{
float sum=0.0,a;int i;
for(i=1;i<=12;i++)
{
cin>>a;
sum+=a;
}
printf("$");
printf("%.2lf\n",sum/12);
return 0;
}

版权声明:本文为博主原创文章,未经博主允许不得转载。

POJ 1004:Financial Management的更多相关文章

  1. 九度OJ 1148:Financial Management(财务管理) (平均数)

    与1141题相同. 时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:843 解决:502 题目描述: Larry graduated this year and finally has a ...

  2. 九度OJ 1141:Financial Management (财务管理) (平均数)

    时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:939 解决:489 题目描述: Larry graduated this year and finally has a job. He's ...

  3. Financial Management POJ - 1004

    Financial Management POJ - 1004 解题思路:水题. #include <iostream> #include <cstdio> #include ...

  4. POJ 3100 Root of the Problem || 1004 Financial Management 洪水!!!

    水两发去建模,晚饭吃跟没吃似的,吃完没感觉啊. ---------------------------分割线"水过....."--------------------------- ...

  5. poj 1004:Financial Management(水题,求平均数)

    Financial Management Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 126087   Accepted: ...

  6. Financial Management 分类: POJ 2015-06-11 10:51 12人阅读 评论(0) 收藏

    Financial Management Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 164431   Accepted: ...

  7. [POJ] #1004# Financial Management : 浮点数运算

    一. 题目 Financial Management Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 173910   Acc ...

  8. [POJ] Financial Management

    Financial Management Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 182193   Accepted: ...

  9. 练习英语ing——[POJ1004]Financial Management

    [POJ1004]Financial Management 试题描述 Larry graduated this year and finally has a job. He's making a lo ...

随机推荐

  1. cover-view子节点溢出父节点被剪切的问题

    因为之前在使用自定义tabbar的时候,使用了cover-view, 导致溢出父节点的那部分被剪切掉,因为没找到有类似的问题出现, 所以我在布局方面做了调整: .tab-bar { overflowY ...

  2. JS链接转换为二维码

    这里用到一个JQ插件 qrcode.js   下载地址https://github.com/jeromeetienne/jquery-qrcode 先引入 <script src="j ...

  3. rsa免密钥登陆

    #第一步 生成密钥,一路回车就行 ssh-keygen -t rsa #第二步 将密钥拷贝到目标服务器上,注意双引号 ssh-copy-id -i ~/.ssh/id_rsa.pub "ro ...

  4. SeekBar和RatingBar的基本使用方法

    SeekBar: main.xml: <?xml version="1.0" encoding="utf-8"?> <LinearLayout ...

  5. luogu P2763 试题库问题

    本题可以用最大流也可以用最大匹配(本质一样),用dinic最大流好建图,但码量大,匈牙利码量小,建图费点劲. 最大流:依旧是设一个源点一个汇点,对于每一个种类,连一条到汇点的边,capacity为需要 ...

  6. P1092 最好吃的月饼

    1092 最好吃的月饼 (20分)   月饼是久负盛名的中国传统糕点之一,自唐朝以来,已经发展出几百品种. 若想评比出一种“最好吃”的月饼,那势必在吃货界引发一场腥风血雨…… 在这里我们用数字说话,给 ...

  7. vSphere 计算vMotion的迁移原理

    1. 计算vMotion 的应用场景 1). 计划内停机维护 2). 提高资源的利用率 2. 计算vMotion 需求: 1).共享存储 vMotion需要解决的核心问题就是:将VMs的内存从源ESX ...

  8. 在linux7(centos)中安装python3.7.2

    一般情况下linux上都默认安装了python,检查一下我的版本 没有安装python3,但是目前已经是python3了,所以为了方便,还是要在系统上安装一下比较好. 上面的命令,直接输入python ...

  9. List<string>绑定到DataGridView控件

    问题 将一个简单的List<string>作为数据源绑定到 DataGridView myDataGridView.DataSource = myStringList; 但是只得到一个名为 ...

  10. 安装mysql server5.5 到start service未响应解决方法

    打开C盘,然后修改    "组织"  =>  "查看"(如下图)  里面的  "隐藏受保护的操作系统文件"  (系统这是会弹出警告,不 ...