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

  1. 100.00
  2. 489.12
  3. 12454.12
  4. 1234.10
  5. 823.05
  6. 109.20
  7. 5.27
  8. 1542.25
  9. 839.18
  10. 83.99
  11. 1295.01
  12. 1.75

Sample Output

  1. $1581.42
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. double x, sum = 0;
  6. int n = 12;
  7. while(n --)
  8. {
  9. cin >> x;
  10. sum += x;
  11. }
  12. cout << '$' << sum / 12.0 << endl;
  13. return 0;
  14. }

Financial Management(SDUT 1007)的更多相关文章

  1. Java Business Process Management(业务流程管理) 初识环境搭建

    一.简介 (一)什么是jbpm JBPM,全称是Java Business Process Management(业务流程管理),它是覆盖了业务流程管理.工作流.服务协作等领域的一个开源的.灵活的.易 ...

  2. poj 1004:Financial Management(水题,求平均数)

    Financial Management Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 126087   Accepted: ...

  3. 数据结构实验之排序五:归并求逆序数(SDUT 3402)

    归并排序详解(戳我). 以下是搬了别人的. #include<stdio.h> #include<stdlib.h> long long sum = 0; int a[1000 ...

  4. 数据结构实验之二叉树六:哈夫曼编码(SDUT 3345)

    题解:离散中的"最小生成树(最优树)". #include <bits/stdc++.h> using namespace std; void qusort(int l ...

  5. 学密码学一定得学程序(SDUT 2463)

    Problem Description 曾经,ZYJ同学非常喜欢密码学.有一天,他发现了一个很长很长的字符串S1.他很好奇那代表着什么,于是神奇的WL给了他另一个字符串S2.但是很不幸的是,WL忘记跟 ...

  6. 顺序表应用8:最大子段和之动态规划法(SDUT 3665)

    Problem Description 给定n(1<=n<=100000)个整数(可能为负数)组成的序列a[1],a[2],a[3],-,a[n],求该序列如a[i]+a[i+1]+-+a ...

  7. 九度OJ 1148:Financial Management(财务管理) (平均数)

    与1141题相同. 时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:843 解决:502 题目描述: Larry graduated this year and finally has a ...

  8. 九度OJ 1141:Financial Management (财务管理) (平均数)

    时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:939 解决:489 题目描述: Larry graduated this year and finally has a job. He's ...

  9. State management(状态管理)

    State management https://en.wikipedia.org/wiki/State_management UI控件的状态管理, 例如按钮的灰化.只读.显示隐藏等. 特殊地一个控件 ...

随机推荐

  1. 数值分析-Legendre正交多项式 实现函数逼近

    数值分析-Legendre正交多项式 实现函数逼近 2016年12月18日 21:27:54 冰三点水 阅读数 4057   版权声明:本文为博主原创文章,遵循CC 4.0 BY-SA版权协议,转载请 ...

  2. IDEA中安装go插件,如何能够配置go SDK?

    最近在学习go语言,一个是因为区块链的技术热潮,另一个是接手的项目有用到go写多线程高并发,因此决定自学go. 第一个遇到的问题就是环境! 通过一个晚上的摸索,大概步骤如下: 在IDEA中先打开set ...

  3. MyBatis 源码篇-日志模块2

    上一章的案例,配置日志级别为 debug,执行一个简单的查询操作,会将 JDBC 操作打印出来.本章通过 MyBatis 日志部分源码分析它是如何实现日志打印的. 在 MyBatis 的日志模块中有一 ...

  4. MyBatis 源码篇-整体架构

    MyBatis 的整体架构分为三层, 分别是基础支持层.核心处理层和接口层,如下图所示. 基础支持层 反射模块 该模块对 Java 原生的反射进行了良好的封装,提供了更加简洁易用的 API ,方便上层 ...

  5. 怎样在Chrome浏览器上安装 Vue Devtools 扩展程序

    第一步: 前往 GitHub 下载 Vue Devtools 项目文件 https://github.com/vuejs/vue-devtools 注意: 1. 将分支切换为 master 2. 下载 ...

  6. C++反汇编第五讲,认识C++中的Try catch语法,以及在反汇编中还原

    我们以前讲SEH异常处理的时候已经说过了,C++中的Try catch语法只不过是对SEH做了一个封装. 如果不懂SEH异常处理,请点击博客链接熟悉一下,当然如果不想知道,也可以直接往下看.因为异常处 ...

  7. luogu2568GCD题解--欧拉函数

    题目链接 https://www.luogu.org/problemnew/show/P2568 分析 题目即求\(\sum_{i=1}^N \sum_{j=1}^N [gcd(i,j)\) \(is ...

  8. 判断两个list是否元素一样

    首先创建枚举 public enum TheType { type1 = , type2 = , type3 = } 1.如果不考虑顺序,即顺序不一样,只要元素都一样即可 List<TheTyp ...

  9. includes()函数的用法

    在ES5,Array已经提供了indexOf用来查找某个元素的位置,如果不存在就返回-1,但是这个函数在判断数组是否包含某个元素时有两个小不足,第一个是它会返回-1和元素的位置来表示是否包含,在定位方 ...

  10. JPA自带findOne方法报错原因

    是由于jdk8的原因,有可能和spring boot的版本也关系, 两种方式可选 注册,返回类是Optional<Girl>, Optional是jdk8自带的 @GetMapping(v ...