练习英语ing——[POJ1004]Financial Management
[POJ1004]Financial Management
试题描述
输入
输出
输入示例
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
数据规模及约定
数字个数 = 12,结果和输入都在 double 范围内
题解
求 12 个数的平均数。
woc POJ 的 G++ 有毒!double 占位符是 "%.2f" 而不是 "%.2lf",所以只能用 “C++”!!!
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <stack>
#include <vector>
#include <queue>
#include <cstring>
#include <string>
#include <map>
#include <set>
using namespace std; int read() {
int x = 0, f = 1; char c = getchar();
while(!isdigit(c)){ if(c == '-') f = -1; c = getchar(); }
while(isdigit(c)){ x = x * 10 + c - '0'; c = getchar(); }
return x * f;
} int main() {
double sum = 0.0;
for(int i = 1; i <= 12; i++) {
double tmp;
scanf("%lf", &tmp);
sum += tmp;
} printf("$%.2lf\n", sum / 12.0); return 0;
}
练习英语ing——[POJ1004]Financial Management的更多相关文章
- POJ1004 Financial Management
题目来源:http://poj.org/problem?id=1004 题目大意: Larry今年毕业并找到了工作.他开始赚很多的钱,然而他似乎总觉得不够.Larry决定好好掌控他的资产,解决他的财务 ...
- Financial Management[POJ1004]
Financial Management Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 179458 Accepted: ...
- poj 1004:Financial Management(水题,求平均数)
Financial Management Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 126087 Accepted: ...
- 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 ...
随机推荐
- 正确对待bug
正确对待bug 2016-10-09 公众号:一只程序媛 以前我一直以为bug是代码的天敌,我以为好的程序媛写出来的代码是应该没有bug的,零bug是终极奋斗目标. 后来,看到一句话"上帝创 ...
- 传智168期JavaEE就业班 day05-XML 约束与解析
* 课程回顾: * DOM解析HTML简介 * DOM 文档对象模型 * 解析器 * document对象 * getElementById("id的值"); 返回一个元素(标签) ...
- javascript this 详解
前言 Javascript是一门基于对象的动态语言,也就是说,所有东西都是对象,一个很典型的例子就是函数也被视为普通的对象.Javascript可以通过一定的设计模式来实现面向对象的编程,其中this ...
- Webform之Repeater中的单选和多选的应用以及前段JS的实现
HTML中的代码 <asp:Repeater ID="Repeater1" runat="server"> <HeaderTemplate&g ...
- A星寻路算法
A星寻路算法 1.准备一个close关闭列表(存放已被检索的点),一个open开启列表(存放未被检索的点),一个当前点的对象cur 2.将cur设成开始点 3.从cur起,将cur点放入close表中 ...
- Yii2分页
Yii中的分页功能主要由yii\web: Linkable接口.yii\widgets: LinkPager类和yii\data: Pagination类三个组成 yii\data: Paginati ...
- 全排列(java版)
适用于不同数字的全排列,其实也适用于有重复数字的全排列,只不过的出来的结果有重复,需手动删减掉重复的组合. package testFullPermutation; import java.util. ...
- sql注入实例分析
什么是SQL注入攻击?引用百度百科的解释: sql注入_百度百科: 所谓SQL注入,就是通过把SQL命令插入到Web表单提交或输入域名或页面请求的查询字符串,最终达到欺骗服务器执行恶意的SQL命令.具 ...
- 栈的的链式实例LinkStack实现
1.#include <stdio.h>#include <malloc.h>#include "LinkList.h"typedef struct _ta ...
- fiddler 挂载 JS文件
有时候,网站 JS 有问题,或者我们想调试JS,就修改了JS,,然后希望它在本地能与网站一起运行,就需要用到 挂载JS了