Title: http://acm.gdufe.edu.cn/Problem/read/id/1030
Financial managementtime limit:4000/2000ms (java/others) problem Description:
Larry graduated this, and finally has a job. He's making a lot of money, but somehow never seems to has enough. Larry has decided the he needs to grab hold of his financial portfolio and solve his financing problems. The first step is to a figure out what's been going on with the he money. Larry has the He bank account statements and wants to see how the much money he had. Help-Larry by writing-a program-to-take he closing balance from each of the past twelve months and calculate his average Account balance.
Input:
The input would be twelve lines. Each line would contain the closing balance of his bank account for a particular month. Each number is positive and displayed to the penny. No dollar sign would be included.
Output:
Sample Input:
123.453.6537.54845.4365.23545.572.003.42334.52535.6756.32.34
Sample Output:
$212.93
Idea: Add a few numbers and divide by 12.
Difficulty: Very simple
Code:
1#include <stdio.h>2 intMain ()3 {4 Doublen,sum;5 inti;6sum=0;7 for(i=0;i< A; i++)8{scanf ("%LF",&n);9sum=sum+N;}Tenprintf"$%.2lf\n", sum/ A); One return 0; A}
Gdufe ACM-1030