Cainiao learns ACM to record the details of their own growth. On the way to learning, I will share with you. ACM learning-POJ-1003-Financial Management Financial ManagementTime Limit: 1000 MS Memory Limit: 10000 KTotal Submissions: 109412 Accepted: 51958 DescriptionLarry 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 ou T 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. inputThe input will be twelve lines. each line will contain the closing balance of his bank account for a participant month. each number will be p Ositive and displayed to the penny. no dollar sign will be removed ded. outputThe 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 Input100.00489.1212454.121234.10823.05109.205. 271542.25839.1883.991295.011.75Sample Output $ 1581.42SourceMid-Atlanta 2001 problem requirement: calculate the average number of 12. Analysis of the problem:... the question was thrown into a fright. I started with the AC rate. Start from 50%. But the AC rate is 48%. It is estimated that the bulls are not willing to do this. Well, there is nothing special to pay attention. That is, pay attention to the type conversion. Run the Code directly.
#include <stdio.h> int main() { int n = 0; double sum_ = 0.0; double each_month; while (~scanf("%lf", &each_month) && n < 12) { sum_ += each_month; n++; if (n==12) { printf("$%.2lf\n", sum_/(double)n); break; } } return 0; }