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 participant month. each number will be positive and displayed to the penny. no dollar sign will be removed ded.
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
The meaning of this question is very simple, that is, to calculate the average, but it seems that the C language is more complex, which is related to the decimal precision.
# include
using namespace STD; int main () {double A, sum; while (CIN> A) {sum = 0; sum + = A; int n = 11; while (n --) {CIN> A; sum + = ;} cout <"$"