Time Limit: 1000MS | Memory Limit: 10000K | |
Total Submissions: 126087 | Accepted: 55836 |
Description
Input
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
Source
1 #include <iostream>
2 #include <stdio.h>
3 using namespace std;
4
5 int main()
6 {
7 double sum = 0,n;
8 int num=0;
9 //freopen("./a.txt","r",stdin);
10 while(cin>>n){ //输入
11 sum+=n;
12 num++;
13 }
14 printf("$%.2f\n",sum/num);
15 return 0;
16 }
Freecode : www.cnblogs.com/yym2013
poj 1004:Financial Management(水题,求平均数),布布扣,bubuko.com
poj 1004:Financial Management(水题,求平均数)
原文:http://www.cnblogs.com/yym2013/p/3757917.html