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

Source

Mid-Atlantic USA 2001

#include<iostream>
#include<cstring>
#include<cstdio>
#include<cmath>

using namespace std;

int main()
{
    double a,sum;
    int i;
    sum = 0;
    for(i = 0;i<12;i++)
    {
        scanf("%lf",&a);
        sum += a;
    }
    printf("$%.2lf\n",sum/12);
    return 0;
}
时间: 2024-11-03 22:39:47

hdu1064Financial Management的相关文章

Lingo 做线性规划 - Revenue Management

Reference: <An Introduction to Management Science Quantitative Approaches to Decision Making, Revised 13th Edition> Leisure Air has two Boeing 737-400 airplanes, one based in Pittsburgh and the other in Newark. Both airplanes have a coach section wi

Lesson9 Exchange 2010 Management Skills

Lesson9 Exchange 2010 Management Skills 1-安装 安装好先决条件容易遗漏的一件事: 下面这个服务一定要改为自动 2-委派安装 从第二台Exchange 2010服务器开始,管理员就可以将域用户添加到delegated setup组中,委派域用户完成 Exchange 2010 的部署 委派组: 先在第一台 exchangerun下面的命令 就是让第二台exchange server加入到组织中 回到第二台exchange server上安装exchange

SQL Server 2014 日志传送部署(4):SQL Server Management Studio部署日志传送

13.2.4 使用Management Studio部署日志传送 使用SQL Server Management Studio来部署日志传送步骤如下: (1)打开主服务器SQLSVR1中作为日志传送的主数据库DB01的属性页面,,然后选择"事务日志传送".选中"将此数据库启用为日志传送配置中的主数据库(E)"复选框. (2)点击"备份设置": 1.填写"备份文件夹网络路径"为\\192.168.1.20\backlog; 2.

Project Management: 敏捷开发纵横谈

摘要:在IT界中,“敏捷”是一个很酷的词汇,“敏捷”的相关理论可谓铺天盖地.“敏捷”一词实质没有统一定义,各家有自家的说法,本教程将让你了解“敏捷”的来龙去脉,抓住“敏捷”本质,并能在工作中实践“敏捷”. 特别声明:如需转载此文,请给出指向本网站的连接,如下:作者:张传波摘自:http://www.umlonline.cn如不能按此要求,请不要转载此文. 大纲:“敏捷”陷阱为什么会有“敏捷”这个说法?极限编程敏捷开发RUP敏捷开发的实质是什么?如何才能敏捷起来? 正文: “敏捷”陷阱 小甲想到某

十一:Centralized Cache Management in HDFS 集中缓存管理

集中的HDFS缓存管理,该机制可以让用户缓存特定的hdfs路径,这些块缓存在堆外内存中.namenode指导datanode完成这个工作. Centralized cache management in HDFS has many significant advantages. Explicit pinning prevents frequently used data from being evicted from memory. This is particularly important

druid抛出的异常------javax.management.InstanceAlreadyExistsException引发的一系列探索

最近项目中有个定时任务的需求,定时检查mysql数据与etcd数据的一致性,具体实现细节就不说了,今天要说的就是实现过程中遇到了druid抛出的异常,以及解决的过程 异常 异常详细信息 五月 05, 2017 4:16:00 下午 com.alibaba.druid.proxy.DruidDriver warn 警告: register druid-driver mbean error javax.management.InstanceAlreadyExistsException: com.al

yum报错:This system is not registered to Red Hat Subscription Management.解决办法

使用yum安装软件,报错如下: [[email protected] ~]# yum -y install mariadbLoaded plugins: langpacks, product-id, subscription-managerThis system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.No package mariadb

HP system management tools centos 7

基本思路就是,手动配置好HP的yum源,更新一下yum,不用管报错信息,直接忽略,然后用yum安装你需要的软件,即可,以下是基本步骤: cd /etc/yum.repos.d vi hp.repo [HP-spp]name=HP Service Pack for ProLiantbaseurl=http://downloads.linux.hp.com/SDR/repo/spp/RHEL/7.1/x86_64/current/enabled=1gpgcheck=0gpgkey=file:///e

UVALive2362 POJ1004 HDU1064 ZOJ1048 Financial Management

Regionals 2001 >> North America - Mid-Atlantic USA 问题链接:UVALive2362 POJ1004 HDU1064 ZOJ1048 Financial Management. 题意简述:输入12个数,计算其平均值. 编写程序时,考虑到C++处理输入比较方便,所以使用C++语言编程.然而,输出需要指定格式是还是C语言方便,所以就用函数printf()来处理输出. AC的C语言程序如下: /* UVALive2362 POJ1004 HDU106