POJ 1004 Financial Management(水题)
来源:互联网 发布:mac dock栏finder恢复 编辑:程序博客网 时间:2024/06/08 11:14
Financial Management
Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 132489 Accepted: 57099
Description
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.
Input
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.
Output
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.
Sample Input
100.00489.1212454.121234.10823.05109.205.271542.25839.1883.991295.011.75
Sample Output
$1581.42
题意:给你12个数求平均数,水的不能再水了、、、、
题目链接:http://poj.org/problem?id=1004
代码:
#include<iostream>#include<cstdio>#include<cstring>#include<cmath>using namespace std;int main(){ double a; int T=12; double ans=0; while(T--){ scanf("%lf",&a); ans+=a; } printf("$%.2f\n",ans/12); return 0;}
0 0
- POJ 1004 Financial Management(水题)
- Financial Management - POJ 1004 水题
- (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
- 用yum给CentOS安装gcc
- try catch finally 与 return 的问题
- Window Classes
- hrbustoj1212 乘积最大 区间DP
- VS2010开发web项目打开后,项目不可用,提示“需要缺少的 Web 组件才能进行加载”
- POJ 1004 Financial Management(水题)
- Java 之 volatile 解析
- 【索引】String
- 并查集基础
- 图解Git【经典】【推荐】
- 设置 Eclipse 智能提示,大幅度减少 alt+/ 使用频率
- 树莓派学习笔记——修改树莓派软件源
- Android 布局之LinearLayout 子控件weight权重的作用详析
- 发生的鬼地方过得好法国恢复