72.Financial Management
- 描述
- 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.
- 输入
- 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.
- 输出
- 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.
- 样例输入
-
100.00
489.12
12454.12
1234.10
823.05
109.20
5.27
1542.25
839.18
83.99
1295.01
1.75 - 样例输出
-
1581.42
1 #include<stdio.h>
2 int main(int argc, char const *argv[]) {//char *argv[]是一个字符数组,其大小是int argc,主要用于命令行参数argv[]
3 double sum = 0, a;
4 int n = 12;
5 while(n--) {
6 scanf("%lf", &a);//%lf双精度浮点型数据(也就是double)的输入格式控制符
7 sum += a;
8 }
9 printf("%.2lf\n", sum/12);
10 return 0;
11 }
72.Financial Management的更多相关文章
- 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 ...
- Financial Management POJ - 1004
Financial Management POJ - 1004 解题思路:水题. #include <iostream> #include <cstdio> #include ...
- UVA 11945 Financial Management 水题
Financial Management Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 acm.hust.edu.cn/vjudge/problem/vis ...
随机推荐
- 三款超实用,好用的Python开发IDE推荐,看完总会有一款合适你的
@ 目录 前言 IDE介绍 Sublime Pycharm(推荐使用社区版免费版) visualstudio 倒底怎么选择 前言 一款好的代码编辑工具,让你学习事半功能,那今天就来看看我们学Pytho ...
- Jmeter压测学习3---通过正则表达式提取token
上一个随笔记录的是用json提取器提取token,这个随笔记录用正则表达式提取token 一.添加正则表达式 登录右击添加->后置处理器->正则表达式提取器 正则提取器参数说明: 要检查的 ...
- Spring Boot中使用PostgreSQL数据库
在如今的关系型数据库中,有两个开源产品是你必须知道的.其中一个是MySQL,相信关注我的小伙伴们一定都不陌生,因为之前的Spring Boot关于关系型数据库的所有例子都是对MySQL来介绍的.而今天 ...
- 升级了 Windows 11 正式版,有坑吗?
今天磊哥去公司上班,惊喜的发现 Windows 提示更新了,并且是 Windows 11 正式版,这太让人开心了,二话不说"先升为敬". 下载更新 下载完咱就重启更新呗. Wi ...
- Winform同步调用异步函数死锁原因分析、为什么要用异步
1.前言 几年前,一个开发同学遇到同步调用异步函数出现死锁问题,导致UI界面假死.我解释了一堆,关于状态机.线程池.WindowsFormsSynchronizationContext.Post.co ...
- CSS绘制三角的小技巧
网页中常见一些三角形,使用css直接画出来就可以,不必做成图片或者字体图标当把一个盒子的高和宽的长度都设置为0,并且分别指定边框样式时,就会得到以下图形: 受此启发,可以知道三角是如何制作的(想要保留 ...
- mysql锁场景及排查
1.查询长时间不返回: 在表 t 执行下面的 SQL 语句: mysql> select * from t where id=1; 查询结果长时间不返回. 一般碰到这种情况的话,大概率是表 t ...
- IT行业供应过剩?“减负路线”助你成为人人都想要的抢手开发
开发者的IT技能:良莠不齐,优秀的软件开发人员在招聘时往往可遇不可求.包括国家统计局在内的多家权威机构的报告提示,在数字化转型的浪潮下,市场对于软件开发人员的需求数量已经远远地超过现有开发者群体的数量 ...
- 2.2 DDD Layers & Clean Architecture DDD分层和简洁架构
DDD Layers & Clean Architecture DDD分层和简洁架构 There are four fundamental layers of a Domain Driven ...
- Java:Iterator接口与fail-fast小记
Java:Iterator接口与fail-fast小记 对 Java 中的 Iterator接口 和 fail-fast,做一个微不足道的小小小小记 Iterator Iterator接口 Itera ...