Hdoj 1064 Financial Management
题目描述
Problem 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
解题思路
其实就是求平均值啦....
Code
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cctype>
#include<cstring>
#include<cstdlib>
using namespace std;
int main()
{
double ans,a,t;
int n=12;
while(n--)
{
cin>>t;
ans+=t;
}
printf("$%.2lf\n",ans/12);
return 0;
}
Hdoj 1064 Financial Management的更多相关文章
- HDU 1064 Financial Management
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1064 解题报告:用来凑个题数吧,看题的时间比过题的时间多的多,就是输入12个浮点数,然后输出平均数,只 ...
- 1064 Financial Management
http://acm.hdu.edu.cn/showproblem.php?pid=1064 思路:看懂英文就很简单,就是12个数相加求平均数就ok了. 扩展: C++ 标准输入输出流的控制符 #in ...
- poj 1004:Financial Management(水题,求平均数)
Financial Management Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 126087 Accepted: ...
- Financial Management[POJ1004]
Financial Management Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 179458 Accepted: ...
- 练习英语ing——[POJ1004]Financial Management
[POJ1004]Financial Management 试题描述 Larry graduated this year and finally has a job. He's making a lo ...
- Financial Management 分类: POJ 2015-06-11 10:51 12人阅读 评论(0) 收藏
Financial Management Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 164431 Accepted: ...
- Introduction to Financial Management
Recently,i am learning some useful things about financial management by reading <Essentials of Co ...
- [POJ] #1004# Financial Management : 浮点数运算
一. 题目 Financial Management Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 173910 Acc ...
- Financial Management
Financial Management 时间限制:3000 ms | 内存限制:65535 KB 难度:1 描述 Larry graduated this year and finally ...
随机推荐
- CF915G Coprime Arrays 莫比乌斯反演、差分、前缀和
传送门 差分是真心人类智慧--完全不会 这么经典的式子肯定考虑莫比乌斯反演,不难得到\(b_k = \sum\limits_{i=1}^k \mu(i) \lfloor\frac{k}{i} \rfl ...
- Java8中的HashMap分析
本篇文章是网上多篇文章的精华的总结,结合自己看源代码的一些感悟,其中线程安全性和性能测试部分并未做实践测试,直接是“拿来”网上的博客的. 哈希表概述 哈希表本质上一个数组,数组中每一个元素称为一个箱子 ...
- .net获取excel表的内容(OleDB方法)
首先引用组件和命名空间 using Microsoft.Office.Interop.Excel; using System.Data.OleDb; 然后把excel上传到指定路径 上传文件方法省略 ...
- 安卓自动化测试案例(跑在MonkeyRunner上)
首先文件所在目录: MonkeyRunner所在目录: 运行命令(通过cd 命令 进入Tools目录下): 运行脚本:monkeyrunner.bat ..\honeywell\jsq.py 源文件 ...
- Java HTML to PDF 支持SVG
尝试一 (现用框架的基础上改动,影响最小化) 最早使用的框架 Xhtmlrenderer,需要把HTML转换成XHTML,引入第二个框架Tidy,Tidy与2010年停止更新,github上的项目也停 ...
- Docker 快速验证 HTML 导出 PDF 高效方案
需求分析 项目中用到了 Echarts,想要把图文混排,当然包括 echarts 生成的 Canvas 图也导出 PDF. 设计和实现时,分析了 POI.iText.freemaker.world 的 ...
- Java Mongo 自定义序列化笔记
从insert方法入手 1. org.springframework.data.mongodb.repository.support.SimpleMongoRepository.java inse ...
- Elasticsearch学习总结 (Centos7下Elasticsearch集群部署记录)
一. ElasticSearch简单介绍 ElasticSearch是一个基于Lucene的搜索服务器.它提供了一个分布式多用户能力的全文搜索引擎,基于RESTful web接口.Elasticse ...
- Python基础系列讲解——random模块随机数的生成
随机数参与的应用场景大家一定不会陌生,比如密码加盐时会在原密码上关联一串随机数,蒙特卡洛算法会通过随机数采样等等.Python内置的random模块提供了生成随机数的方法,使用这些方法时需要导入ran ...
- 基于SSH的高校网上选课系统的质量属性的实现
我对于基于SSH的高校网上选课系统的质量属性的实现是从可用性.性能.安全性.可维护性.易用性五个方面进行的实现. 可用性方面: 实现方式:(1)当系统试图超出限制范围来进行课程查询或选课时必须进行错误 ...