博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
OpenJudge/Poj 1004 Financial Management
阅读量:6907 次
发布时间:2019-06-27

本文共 1487 字,大约阅读时间需要 4 分钟。

1.链接地址:

2.题目:

总时间限制:
1000ms
内存限制:
65536kB
描述
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.
输入
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.
输出
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.
样例输入
100.00489.1212454.121234.10823.05109.205.271542.25839.1883.991295.011.75
样例输出
$1581.42
来源
Mid-Atlantic 2001

3.思路:

4.代码:

1 #include "stdio.h" 2 //#include "stdlib.h" 3 int main() 4 { 5     int i=0; 6     float tmp=0,sum=0; 7     for(i=0;i<12;i++) 8     { 9        scanf("%f",&tmp);10        sum+=tmp;11     }12     printf("$%.2f",sum/12);13     //system("pause");14     return 0;15 }

 

转载于:https://www.cnblogs.com/mobileliker/p/3544729.html

你可能感兴趣的文章
我的友情链接
查看>>
Jquery Ajax方法传值到action
查看>>
亚马逊图书推荐--我感兴趣的
查看>>
Xmanager连接Centos6.3的远程桌面
查看>>
Office365:客户端升级后无法启动Microsoft Outlook
查看>>
我的友情链接
查看>>
在eclipse中查看Android源代码
查看>>
prometheus+grafana
查看>>
Liferay 启动过程分析3-处理启动事件(第四部分)
查看>>
Rust语言开发基础(七)Rust 特性
查看>>
CountDownLatch示例
查看>>
Windows 8 相关资源 MSDN原版
查看>>
NetScaler VPX 10实施1:NetScaler入门
查看>>
如何优化eclipse
查看>>
互联互通网络质量分析
查看>>
记一次OOM排查解决
查看>>
AIX 6.1 + HACMP 6.1 + Oracle 11g双机实施 (3) --- AIX 6.1 Cloning an Oracle Home
查看>>
阮一峰之webpack-demos(译)
查看>>
(2)在Windows 7 x64端设置Python环境
查看>>
Set
查看>>