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. Mac安装jdk

    jdk:https://blog.csdn.net/zw235345721/article/details/78702254 mysql:https://www.jianshu.com/p/fd3aa ...

  2. 如何使用Docker部署PHP开发环境

    本文主要介绍了如何使用Docker构建PHP的开发环境,文中作者也探讨了构建基于Docker的开发环境应该使用单容器还是多容器,各有什么利弊.推荐PHP开发者阅读.希望对大家有所帮助. 环境部署一直是 ...

  3. 题解 P5043 【【模板】树同构([BJOI2015]树的同构)】

    进入正题 题意:将所有树结构相同的树归类. 思路 嗯,这道题让我们把树的结构归类,自然而然就想到了哈希,我们对这整颗树哈希一遍.然后判同构就十分之简单了.只需要找哈希值一样的树就可以了. 其实真得很简 ...

  4. [题解 LuoguP4491 [HAOI2018]染色

    传送门 神仙计数题 Orz 先令\(F[k]\)表示出现次数恰好为\(S\)次的颜色恰好有\(k\)中的方案数,那么 \[Ans=\sum\limits_{i=0}^mW_iF[i]\] 怎么求\(F ...

  5. Python协程理解——基于爬虫举例

    当前代码在工作当中没有太大的含义,但是对于大家理解协程的基础概念是相当有好处的协程最直接的可以理解为程序当中一个没有返回的功能块儿我们之前有学过多线程,所谓的多线程不论是异步并发,还是并发强调的时候将 ...

  6. Echarts 折线图y轴标签值过长 显示

    参考: https://blog.csdn.net/dandelion_drq/article/details/79270597 改变Y轴单位:https://www.cnblogs.com/cons ...

  7. open-source--攻防世界

    题目直接给了源码,发现只要跳过条件就可以得到flag

  8. 我的Grunt之旅-序章

    时间:2018-03-05 13:52  事件:安装Grunt 相关网址: grunt官网:https://gruntjs.com node.js下载地址 :https://nodejs.org/en ...

  9. List<Object> 查询解析优化

    2018年3月16日 大型仪器设备分类查出后,需要展示个分类下总共有多少台设备.因为分类总共分三层,加起来数据700+.以后该系统上线设备可能达到2000+,这样统计每个分类下的设备可能会拖垮服务器. ...

  10. centos7创建ssh公钥

    步骤1:使用ssh-keygen命令创建公钥和私钥 [root@model /]# [root@model /]# ssh-keygen -t rsa -P '' Generating public/ ...