nyoj 72-Financial Management (求和 ÷ 12.0)
72-Financial Management
内存限制:64MB
时间限制:3000ms
特判: No
通过数:7
提交数:12
难度:1
题目描述:
输入描述:
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~12月的money相加再除以12,得到的结果保留两位小数 C/C++代码实现(AC);
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <stack>
#include <map>
#include <queue>
#include <set> using namespace std;
const int MAXN = ;
int A[MAXN]; int main()
{
double a, cnt = 0.0;
for(int i = ; i < ; ++ i)
{
scanf("%lf", &a);
cnt += a;
}
printf("%.2lf", cnt / 12.0);
return ;
}
nyoj 72-Financial Management (求和 ÷ 12.0)的更多相关文章
- 72.Financial Management
描述 Larry graduated this year and finally has a job. He's making a lot of money, but somehow never se ...
- Financial Management 分类: POJ 2015-06-11 10:51 12人阅读 评论(0) 收藏
Financial Management Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 164431 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
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 ...
- [POJ] Financial Management
Financial Management Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 182193 Accepted: ...
- POJ 3100 Root of the Problem || 1004 Financial Management 洪水!!!
水两发去建模,晚饭吃跟没吃似的,吃完没感觉啊. ---------------------------分割线"水过....."--------------------------- ...
随机推荐
- python学习-列表、元组和字典(三)
学习笔记中的源码:传送门 3.1 列表和元组 3.2 不同类型变量的初始化: 数值 digital_value = 0 字符串 str_value = "" 或 str_value ...
- 百万年薪python之路 -- 列表练习
1.写代码,有如下列表,按照要求实现每一个功能 li = ["alex", "WuSir", "ritian", "barry&q ...
- 百万年薪python之路 -- python的历史
1.python的历史 2004 Django框架诞生了 python2: 源码不统一,有重复的功能代码 python3: 源码统一,没有重复的功能 2.python是一个什么编程 ...
- QLable 显示图片
1,各种对就是不显示,因为路径中有其它符号如\n\r什么的 QStringList FileOpeartion::PathCombine (const QString strPath, QString ...
- 【redis】redis的过期策略
redis过期策略 在使用redis做缓存的时候,我们常常会设置过期时间.那么redis是如何清理这些过期的数据呢? 答案是: 定期删除 + 惰性删除 定期删除: redis每100ms就会随机抽查删 ...
- .net layui 批量导出
.net开发,前台使用layui框架,后台使用WCF 废话不多,直接上代码 1>文件引用: admin.css layui.css layui.js jquery.min.js layerToo ...
- Nexus安装(Windows)
1. nexus下载 官网下载:https://www.sonatype.com/download-oss-sonatype 网盘下载:https://pan.baidu.com/s/1CXOW7Lv ...
- 《Effective Java》 读书笔记(二) 在构造参数过多的时候优先考虑使用构造器
刚开始看见这个标题的时候,我想到了python可以选择初始化参数的语法,C++.C#能有默认参数. 为什么Java什么都没有~~ 好吧,我们是使用构造器来实现它. 1.当一个类的构造函数需要很多构造函 ...
- [loj2546][JSOI2018]潜入行动(树形DP)
题目描述 外星人又双叒叕要攻打地球了,外星母舰已经向地球航行!这一次,JYY 已经联系好了黄金舰队,打算联合所有 JSOIer 抵御外星人的进攻. 在黄金舰队就位之前,JYY 打算事先了解外星人的进攻 ...
- 刷题翻车:python 布尔运算操作符的优先级
前两天在 xue.cn 体验答题挑战,我有道题做错了,却不明白错在哪里.题目大概如下,代码运行后将打印什么? if True or False and False: print('1') else: ...