HDOJ 1064Financial Management

简介: Problem Description Larry graduated this year and finally has a job. He’s making a lot of money, but somehow never seems to have enough.

Problem 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 particular month. Each number will be positive and displayed to the penny. No dollar sign will be included.

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.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

#include<stdio.h>
int main()
{
    int i;
    double a,s;
    s=0;
    for(i=1;i<=12;i++)
     {
       scanf("%lf",&a);
       s+=a;
     }
    printf("$%.2lf\n",s/12);
    return 0;
}
目录
相关文章
《How Customers Are Using the IBM Data Science Experience-Expected Cases and Not So Expected Ones》电子版地
How Customers Are Using the IBM Data Science Experience-Expected Cases and Not So Expected Ones
《How Customers Are Using the IBM Data Science Experience-Expected Cases and Not So Expected Ones》电子版地
Choosing Teams
Choosing Teams
100 0
Choosing Teams
HDOJ 1064Financial Management
HDOJ 1064Financial Management
88 0
HDOJ 1064 Financial Management
HDOJ 1064 Financial Management
66 0
|
JavaScript 前端开发 vr&ar
Use Augmented Reality technology to bring enhanced customer experience
Use Augmented Reality technology to bring enhanced customer experience
91 0
Use Augmented Reality technology to bring enhanced customer experience
|
XML 数据格式
Some more technical details about SAP note
I use this note 2184333 which I am responsible for as an example:
123 0
Some more technical details about SAP note
|
算法
Reading《Practical lessons from predicting clicks on Ads at Facebook》(1)
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/sinat_32502811/article/details/80794980 因为在做京东的算法大赛,小白选手,看了一些别人的入门级程序,胡乱改了一通,也没有什么大的进展,而且感觉比赛的问题和点击率预估还是有点像的,所以搜了个论文来读,看看牛人们的思路。
2244 0
6 Major Changes in Science and Technology Reshaping the Retail Industry
As the transformation of the retail industry deepens, consumers are now at the center of the entire industry ecosystem.
3782 0
6 Major Changes in Science and Technology Reshaping the Retail Industry
The Rising Smart Logistics Industry: How to Use Big Data to Improve Efficiency and Save Costs
This whitepaper will examine Alibaba Cloud’s Cainiao smart logistics cloud and Big Data powered platform and the underlying strategies used to optimiz.
1504 0
The Rising Smart Logistics Industry: How to Use Big Data to Improve Efficiency and Save Costs
|
安全 Go
Improving your Organizations Data Governance Scorecard
This whitepaper looks at how businesses can improve their scores on the tests of three fundamental data governance areas.
1321 0