POJ1004算法解析
来源:互联网 发布:数据洪流 编辑:程序博客网 时间:2024/06/03 16:46
POJ1004
Financial Management
Time Limit: 1000MS Memory Limit: 10000K
Total Submissions: 185780 Accepted: 70505
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.00
489.12
12454.12
1234.10
823.05
109.20
5.27
1542.25
839.18
83.99
1295.01
1.75
Sample Output
$1581.42
AC代码(C语言):
#include <stdio.h> int main(){ int i; float num[12]; double sum=0; for(i=0;i<12;i++){ scanf("%f",&num[i]); sum+=num[i]; } sum=sum/12.0; printf("$%.2f",sum);}
- POJ1004算法解析
- POJ1004
- poj1004
- poj1004
- poj1004
- POJ1004
- POJ1004
- poj1004
- POJ1004
- poj1004
- POJ1004
- poj1004
- POJ1004
- POJ1004
- poj1004
- poj1004
- Poj1004
- poj1004
- 选择合适的Chrome浏览器安装进行WebGL的开发调试
- 如何使用openssl生成RSA公钥和私钥对
- 晒晒太阳,眼镜就能为手机充电,甚至窗户都成了“发电厂”
- leetcode--Linked List Cycle
- springmvc上传图片并显示图片--支持多图片上传
- POJ1004算法解析
- 数值积分
- SpringMVC使用@Valid注解进行数据验证
- 欢迎使用CSDN-markdown编辑器
- 函数声明和函数表达式的区别
- leetcode--Linked List Cycle II
- B. Petya and Staircases----思维题
- e.target和e.currentarget还有this的区别
- leetcode--Reorder List