POJ 1004 Financial Management
来源:互联网 发布:青岛中山路美食 知乎 编辑:程序博客网 时间:2024/06/06 02:22
文档来源
Description
拉里今年毕业了,终于找到了一份工作。他赚了很多钱,但不知怎么的似乎没有足够的钱。拉里已经决定,他需要抓住他的金融投资组合,解决他的融资问题。第一步是弄清楚他的钱是怎么回事。拉里有自己的银行账户,想看看他有多少钱。帮助拉里写一个程序,从过去12个月的每一个月,计算他的余额,计算他的平均账户余额
Input
输入将是12行。每行将包含一个月的银行账户的余额。
Output
输出将是一个单一的数字,即12个月的期末余额的平均值(平均值)。它会被四舍五入到最接近的一分钱,前面是一个美元的符号,然后是行尾。输出中没有其他空格或字符。
Sample Input
100.00489.1212454.121234.10823.05109.205.271542.25839.1883.991295.011.75
Sample Output
$1581.42
Source
Mid-Atlantic 2001
Code
#include <cstdio>#include <algorithm>#include <iostream>#include <cstring>#include <fstream>#include <map>#include <queue>#include <set>#include <cstdlib>#include <ctime>#include <vector>#include <cmath>#include <limits.h>using namespace std;int main(){ double ans=0, num; for(int i=0; i<12; i++) { scanf("%lf", &num); ans += num; } printf("$%.2lf\n", ans/12); return 0;}
阅读全文
0 0
- 【POJ】1004 Financial Management
- POJ-1004:Financial Management
- POJ 1004 Financial Management
- POJ 1004 Financial Management
- [POJ]1004 Financial Management
- POJ 1004 Financial Management
- poj 1004 Financial Management
- poj 1004 Financial Management
- POJ-1004-Financial Management
- poj 1004 Financial Management
- POJ 1004 Financial Management
- [POJ][1004]Financial Management
- POJ 1004 Financial Management
- POJ 1004 Financial Management
- poj 1004 Financial Management
- poj 1004 Financial Management
- POJ 1004 - Financial Management
- POJ-1004 Financial Management
- Keras中将LSTM用于mnist手写数字识别
- 浏览器---Chrome前端开发必备插件,如何设置代理,react调试,定死https协议,sublime热更新,浏览器发请求post
- jsp数据交互
- ES5/ES6
- 算法题 100:快速售票系统的座位登记
- POJ 1004 Financial Management
- head fiest 设计模式第一章
- VueJs—常用操作手册
- 动态规划——不同的路径
- 【脚本语言系列】关于Python远程调用,你需要知道的事
- 当你在浏览器中输入Google.com并且按下回车之后发生了什么?
- 替换空格
- 哈夫曼树 (c语言)数据结构
- Valgrind内存泄漏检查及定位利器