九度OJ 1148:Financial Management(财务管理) (平均数)
与1141题相同。
时间限制:1 秒
内存限制:32 兆
特殊判题:否
提交:843
解决:502
- 题目描述:
-
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.
- 输入:
-
Each case 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.
- 输出:
-
For each case, 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
代码:
#include <stdio.h> int main(void)
{
int n, i;
double cost;
double sum; while (scanf("%lf", &cost) != EOF)
{
sum = cost;
for(i=1; i<12; i++)
{
scanf("%lf", &cost);
sum += cost;
}
printf("$%.2lf\n", sum/12);
} return 0;
}
/**************************************************************
Problem: 1148
User: liangrx06
Language: C
Result: Accepted
Time:0 ms
Memory:912 kb
****************************************************************/
九度OJ 1148:Financial Management(财务管理) (平均数)的更多相关文章
- 九度oj 题目1087:约数的个数
题目链接:http://ac.jobdu.com/problem.php?pid=1087 题目描述: 输入n个整数,依次输出每个数的约数的个数 输入: 输入的第一行为N,即数组的个数(N<=1 ...
- 九度OJ 1502 最大值最小化(JAVA)
题目1502:最大值最小化(二分答案) 九度OJ Java import java.util.Scanner; public class Main { public static int max(in ...
- 九度OJ,题目1089:数字反转
题目描述: 12翻一下是21,34翻一下是43,12+34是46,46翻一下是64,现在又任意两个正整数,问他们两个数反转的和是否等于两个数的和的反转. 输入: 第一行一个正整数表示测试数据的个数n. ...
- 九度OJ 1500 出操队形 -- 动态规划(最长上升子序列)
题目地址:http://ac.jobdu.com/problem.php?pid=1500 题目描述: 在读高中的时候,每天早上学校都要组织全校的师生进行跑步来锻炼身体,每当出操令吹响时,大家就开始往 ...
- 九度OJ 1531 货币面值(网易游戏2013年校园招聘笔试题) -- 动态规划
题目地址:http://ac.jobdu.com/problem.php?pid=1531 题目描述: 小虎是游戏中的一个国王,在他管理的国家中发行了很多不同面额的纸币,用这些纸币进行任意的组合可以在 ...
- 九度OJ 1024 畅通工程 -- 并查集、贪心算法(最小生成树)
题目地址:http://ac.jobdu.com/problem.php?pid=1024 题目描述: 省政府"畅通工程"的目标是使全省任何两个村庄间都可以实现公路交通(但 ...
- 九度OJ 1371 最小的K个数 -- 堆排序
题目地址:http://ac.jobdu.com/problem.php?pid=1371 题目描述: 输入n个整数,找出其中最小的K个数.例如输入4,5,1,6,2,7,3,8这8个数字,则最小的4 ...
- 九度OJ 题目1384:二维数组中的查找
/********************************* * 日期:2013-10-11 * 作者:SJF0115 * 题号: 九度OJ 题目1384:二维数组中的查找 * 来源:http ...
- hdu 1284 关于钱币兑换的一系列问题 九度oj 题目1408:吃豆机器人
钱币兑换问题 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Sub ...
随机推荐
- 微信公众号开发C#系列-12、微信前端开发利器:WeUI
1.前言 通过前面系列文章的学习与讲解,相信大家已经对微信的开发有了一个全新的认识.后端基本能够基于盛派的第三方sdk搞定大部分事宜,剩下的就是前端了.关于手机端的浏览器的兼容性问题相信一直是开发者们 ...
- java JIT AOT
作者:ETIN链接:https://zhuanlan.zhihu.com/p/27393316来源:知乎著作权归作者所有.商业转载请联系作者获得授权,非商业转载请注明出处. I guess anyon ...
- 2016集训测试赛(二十)Problem B: 字典树
题目大意 你们自己感受一下原题的画风... 我怀疑出题人当年就是语文爆零的 下面复述一下出题人的意思: 操作1: 给你一个点集, 要你在trie上找到所有这样的点, 满足点集中存在某个点所表示的字符串 ...
- delphi中如何将string类型的字符串数据转化成byte[]字节数组类型的数据
var S:String; P:PChar; B:array of Byte;begin S:='Hello'; SetLength(B,Length(S)+1); P:=PChar(S) ...
- SQLITE3 --详解
由于我主要负责我们小组项目数据库模块的部分所以这几天都一直在研究在iphone中最为常用的一个简单数据库sqlite,自己也搜集很多资料,因此在 这里总结一下这几天的学习成果: Sqlite 操作简明 ...
- linux查看端口状态相关命令
netstat netstat 命令应用是比较频繁的,比如查看端口占用啦,查看端口进程啦,这些时候都是有必要的. netstat命令各个参数说明如下: -t : 指明显示TCP端口 -u : 指明显示 ...
- MVC4 Task.Factory.StartNew 异步调用
MVC4也添加了一些异步的东西,不过一枝都没有研究过. 工作上遇到了发出一个调用,但是不去管调用结果如何的情况,在谢平师傅的指导下, 写成如下异步方式 Task.Factory.StartNew(() ...
- 快速乘法,幂计算 hdu5666
在实际应用中为了防止数据爆出,在计算a*b%m和x^n%m时,可以采用此方法.在数论中有以下结论: a*b%m=((a%m)*(b*m))%m ; (a+b)%m=(a%m+b%m)%m ; _int ...
- 关于embedding-深度学习基本操作 【Word2vec, Item2vec,graph embedding】
https://zhuanlan.zhihu.com/p/26306795 https://arxiv.org/pdf/1411.2738.pdf https://zhuanlan.zhihu.com ...
- overlay和overlay2的区别
docker作为一个容器平台,它有一套自己的存储系统.它支持的driver有overlay,overlay2, aufs等等. 这篇文章主要分析overlay和overlay2的区别. overlay ...