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

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

Source

 
  水题,求平均数
  题意:给你多个数,要求你输出他们的平均数。
  思路:没什么好说的……
  代码
 #include <iostream>
#include <stdio.h>
using namespace std; int main()
{
double sum = ,n;
int num=;
//freopen("./a.txt","r",stdin);
while(cin>>n){ //输入
sum+=n;
num++;
}
printf("$%.2f\n",sum/num);
return ;
}

Freecode : www.cnblogs.com/yym2013

poj 1004:Financial Management(水题,求平均数)的更多相关文章

  1. UVA 11945 Financial Management 水题

    Financial Management Time Limit: 1 Sec  Memory Limit: 256 MB 题目连接 acm.hust.edu.cn/vjudge/problem/vis ...

  2. poj 1004 Financial Management

    求平均数,记得之前在杭电oj上做过一个求平均数的题目,结果因为题目是英文的,我就懵逼了 #include <stdio.h> int main() { ; double num; int ...

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

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

  4. OpenJudge/Poj 1004 Financial Management

    1.链接地址: http://poj.org/problem?id=1004 http://bailian.openjudge.cn/practice/1004 2.题目: 总时间限制: 1000ms ...

  5. [POJ 1004] Financial Management C++解题

    参考:https://www.cnblogs.com/BTMaster/p/3525008.html #include <iostream> #include <cstdio> ...

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

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

  7. POJ 1488 Tex Quotes --- 水题

    POJ 1488 题目大意:给定一篇文章,将它的左引号转成 ``(1的左边),右引号转成 ''(两个 ' ) 解题思路:水题,设置一个bool变量标记是左引号还是右引号即可 /* POJ 1488 T ...

  8. poj 1006:Biorhythms(水题,经典题,中国剩余定理)

    Biorhythms Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 110991   Accepted: 34541 Des ...

  9. poj 1003:Hangover(水题,数学模拟)

    Hangover Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 99450   Accepted: 48213 Descri ...

随机推荐

  1. mac 搭建APK反编译环境[转]

    APKtool 用途:获取mainifest.xml res等资源文件 下载:http://ibotpeaches.github.io/Apktool/install/ 使用:apktool d te ...

  2. python——有限状态机

    前言 使用Python,大部分时间花在了处理文本上.在处理文本的时候,如果对有限状态机有所了解的话,处理起来会更加得心应手.可以把文本看成一个流,然后有一个机器对这个流进行操作.这个机器有状态,不同的 ...

  3. VRRP虚拟路由器冗余协议

    VRRP(VirtualRouterRedundancyProtocol,虚拟路由冗余协议)是一种容错协议.通常,一个网络内的所有主机都设置一条缺省路由,这样,主机发出的目的地址不在本网段的报文将被通 ...

  4. css 图形,非常完美

    http://www.360doc.com/content/12/0327/13/8674_198243134.shtml

  5. host位置

    windows xp/2003/vista/2008用户HOSTS文件是在“c:\windows\system32\drivers\etc”

  6. 在wpf中使用winrt的Toast弹框效果

    源码地址:https://code.msdn.microsoft.com/windowsdesktop/Sending-toast-notifications-71e230a2/sourcecode? ...

  7. ABAP 内表的行列转换-发货通知单-打印到Excel里-NEW

    *********************************************************************** * Title           : ZSDF002  ...

  8. Effective C++ -----条款19:设计class犹如设计type

    Class的设计就是type的设计.在定义一个新type之前,请确定你已经考虑过本条款覆盖的所有讨论主题. 新type的对象应该如何被创建和销毁? 对象的初始化和对象的赋值该有什么样的区别? 新typ ...

  9. jQuery中attr()方法用法实例

    本文实例讲述了jQuery中attr()方法用法.分享给大家供大家参考.具体分析如下: 此方法设置或返回匹配元素的属性值. attr()方法根据参数的不同,功能也不同. 语法结构一: 获取第一个匹配元 ...

  10. vector在C++中的基本用法

    在写BlackJackGame的时候,考虑到要用到容器,所以就对容器的相关知识强化了一下: 因为我想的是有card类,最后要实现发牌,洗牌等等一系列的操作的时候,使用指向card类的对象的指针,将ca ...