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()
{
int a=0;
double b,s=0;
while(a<12)
{
cin>>b;
s+=b;
a++;
}
double ave=0;
ave=s/12;
cout<<'$'<<ave<<endl; return 0;
}

  

POJ-1004-Finanical Management的更多相关文章

  1. OpenJudge/Poj 1004 Financial Management

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

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

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

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

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

  4. poj 1004 Financial Management

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

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

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

  6. Financial Management POJ - 1004

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

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

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

  8. POJ 1004:Financial Management

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

  9. POJ 1004 解题报告

    1.题目描述: http://poj.org/problem?id=1004 2.解题过程 这个题目咋一看很简单,虽然最终要解出来的确也不难,但是还是稍微有些小把戏在里面,其中最大的把戏就是float ...

  10. poj: 1004

    简单题 #include <iostream> #include <stdio.h> #include <string.h> #include <stack& ...

随机推荐

  1. 腾讯云+校园扶持计划是bug还是福利

    前言   上午突然收到好友的微信消息.打开一看是关于关腾讯云"云+校园扶持计划".仔细看下了意思就是用户可以花360大洋购买腾讯云服务器配置为1核2G,1M带宽的服务器3年.(腾讯 ...

  2. iOS学习 NSString常用技巧

    字符串是程序设计最常用的数据类型之一了.在Mac/iPhone编程中,苹果为我们提供了一个不同的字符串类型NSString.有别与普通的String为数据类型,NSString其实是一个对象类型.NS ...

  3. c# try-finally有什么用

     finally 代码块中的代码是 try-catch 结构执行完后无论有无异常发生都会执行的.finally 代码块中的代码是 try-catch 结构执行完后无论有无异常发生都会执行的.final ...

  4. linux下测试磁盘的读写IO速度

    有时候我们在做维护的时候,总会遇到类似于IO特别高,但不能判定是IO瓶颈还是软件参数设置不当导致热盘的问题.这时候通常希望能知道磁盘的读写速度,来进行下一步的决策. 下面是两种测试方法:(1)使用hd ...

  5. Scrapyd日志输出优化

    现在维护着一个新浪微博爬虫,爬取量已经5亿+,使用了Scrapyd部署分布式. Scrapyd运行时会输出日志到本地,导致日志文件会越来越大,这个其实就是Scrapy控制台的输出.但是这个日志其实有用 ...

  6. TCP粘包、拆包及解决

    TCP属于传输层的协议,传输层除了有TCP协议外还有UDP协议.那么UDP是否会发生粘包或拆包的现象呢?答案是不会.UDP是基于报文发送的,从UDP的帧结构可以看出,在UDP首部采用了16bit来指示 ...

  7. Mysql简单笔记

    对oracle还是比较熟悉的,对mysql也是零散的有些了解,今天看了下,简单总结: 1.查看mysql版本:mysqladmin --version2.查看mysql进程:ps -ef|grep m ...

  8. .Net学习计划

    .Net培训 第一部分:.Net基础        .Net基础:数据类型.变量.运算符.分支结构.循环结构.方法.反编译器.递归.递归算法的非递归优化:        面向对象:异常.封装继承多态. ...

  9. jsTree树形菜单分类

    这里我演示的jsTree是基于ABP框架 ,展示部分代码,话不多说首先看效果如: 1:引入JS <link href="/jstree/themes/default/style.css ...

  10. PyTorch官方中文文档:torch

    torch 包 torch 包含了多维张量的数据结构以及基于其上的多种数学操作.另外,它也提供了多种工具,其中一些可以更有效地对张量和任意类型进行序列化. 它有CUDA 的对应实现,可以在NVIDIA ...