poj1004
来源:互联网 发布:微刊软件 编辑:程序博客网 时间:2024/06/07 08:27
Financial ManagementTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 87798 Accepted: 42766
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
普通的求平均数#include <stdio.h>int main(){float n, sum=0;int i=12;while(i>=1){scanf("%f",&n);sum+=n;i--;}printf("$%.2f\n",sum/12);return 0;}
- POJ1004
- poj1004
- poj1004
- poj1004
- POJ1004
- POJ1004
- poj1004
- POJ1004
- poj1004
- POJ1004
- poj1004
- POJ1004
- POJ1004
- poj1004
- poj1004
- Poj1004
- poj1004
- poj1004
- 游戏开发笔记之三——绘制图元
- RAPI 功能示例与说明
- 单例设计模式总结
- Generic Class和MFC Class和Form Class有何区别?
- 《第十三周实验报告任务1》
- poj1004
- 游戏开发笔记之四——游戏画面绘图(一)基本图形绘制
- 如何让IT人远离慢性疲劳
- 为什么要用Struts2 .
- 1.创建图形化界面
- iOS5.1CoreImage 人脸识别 Demo
- 2.加入窗口监听
- 如何在xp上 设置阻止端口
- poj1005