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 ...
随机推荐
- cmd命令入门
第一类: 介绍原生的DOS 首先在cmd命令输入help,看到如下图的结果,这里展示的原生的DOS命令. 这里列出了一些命令,可以自己试试的玩.一般看到一个命令后,如果没有说明文档,你就尝试的在其命令 ...
- default construction
4种情况下编译器会构造出nontrivial(有用)的构造函数 带有default construction的member class object 我们有两个class: class Foo { p ...
- C_数据结构_数组的修改和删除
#include<stdio.h> typedef struct Node { int a,b; }node; node c[]; int n; void print() { int i; ...
- 安装Visual Studio开发平台
1.找一个VS2013的安装包,下载到D盘上,勾选相应的选项安装. 安装的过程很漫长,至少需要一个小时. 2.安装已完成,启动. . 3.登录. \ 4启动VS2013. 5.新建c#类库 6.输入代 ...
- Spring方法级别的验证
设置验证点及验证方式(1)Spring方法级别的验证有多种验证方式,比较常用的有 @NotBlank:主要是对字符串的验证,不为null且去除空白符之后长度大于0 @NotNull:主要是对对象的验证 ...
- week3-构造一个简单的linux系统
潘恒 原创作品转载请注明出处 <Linux内核分析>MOOC课程http://mooc.study.163.com/course/USTC-1000029000 一.gdb跟踪调试内核 ...
- 面向对象课程 - 寒假第四次作业 - C++计算器项目计算部分
C++计算器项目计算部分 零.项目源文件地址 地址:Calculator 2.0 一.项目信息相关 项 目 : Calculator 版 本 : 2 . 0 日 期 : 2016 . 4 . 14 实 ...
- np.array与np.ndarray区别
(Numpy中ndarray和array的区别是什么?我在哪儿能够找到numpy中相应的实现?) 答:Well, np.array is just a convenience function to ...
- Socket、Session、Option和Pipe
消息队列NetMQ 原理分析4-Socket.Session.Option和Pipe 消息队列NetMQ 原理分析4-Socket.Session.Option和Pipe 前言 介绍 目的 Soc ...
- node基础 npm、module、exports、require
module 模块.包:可以认为是一个代码包,package,提供特定的功能(暴露给外界接口,让外界调用) exports 输出.导出:导出模块中的各种类型的变量,以及各种方法,导出之后,才可以被外界 ...