Financial Management(SDUT 1007)
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 <bits/stdc++.h>
using namespace std;
int main()
{
double x, sum = 0;
int n = 12;
while(n --)
{
cin >> x;
sum += x;
}
cout << '$' << sum / 12.0 << endl;
return 0;
}
Financial Management(SDUT 1007)的更多相关文章
- Java Business Process Management(业务流程管理) 初识环境搭建
一.简介 (一)什么是jbpm JBPM,全称是Java Business Process Management(业务流程管理),它是覆盖了业务流程管理.工作流.服务协作等领域的一个开源的.灵活的.易 ...
- poj 1004:Financial Management(水题,求平均数)
Financial Management Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 126087 Accepted: ...
- 数据结构实验之排序五:归并求逆序数(SDUT 3402)
归并排序详解(戳我). 以下是搬了别人的. #include<stdio.h> #include<stdlib.h> long long sum = 0; int a[1000 ...
- 数据结构实验之二叉树六:哈夫曼编码(SDUT 3345)
题解:离散中的"最小生成树(最优树)". #include <bits/stdc++.h> using namespace std; void qusort(int l ...
- 学密码学一定得学程序(SDUT 2463)
Problem Description 曾经,ZYJ同学非常喜欢密码学.有一天,他发现了一个很长很长的字符串S1.他很好奇那代表着什么,于是神奇的WL给了他另一个字符串S2.但是很不幸的是,WL忘记跟 ...
- 顺序表应用8:最大子段和之动态规划法(SDUT 3665)
Problem Description 给定n(1<=n<=100000)个整数(可能为负数)组成的序列a[1],a[2],a[3],-,a[n],求该序列如a[i]+a[i+1]+-+a ...
- 九度OJ 1148:Financial Management(财务管理) (平均数)
与1141题相同. 时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:843 解决:502 题目描述: Larry graduated this year and finally has a ...
- 九度OJ 1141:Financial Management (财务管理) (平均数)
时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:939 解决:489 题目描述: Larry graduated this year and finally has a job. He's ...
- State management(状态管理)
State management https://en.wikipedia.org/wiki/State_management UI控件的状态管理, 例如按钮的灰化.只读.显示隐藏等. 特殊地一个控件 ...
随机推荐
- 牛客 203B tree(树形dp)
大意: 给定树, 对于每个节点, 求包含该节点的连通子集数. 显然有$dp[x]=\prod (dp[y]+1), ans[x]=(\frac{ans[fa[x]]}{dp[x]+1}+1)dp[x] ...
- GoLang语言环境搭建及idea集成开发(超详细)
一.所需安装包(windows) 1. https://golang.org/dl/ 下载 MSI installer.不会翻墙的自己找国内下载,双击运行,按照提示安装即可.环境变量自动配置 2.i ...
- 小程序wxs是作用
wxs weixin script,小程序的脚本语言:可以结合wxml构建页面结构: 说白了 就是在小程序里面写函数表达式的地方: wxml里面直接使用wxs,有错误再次刷新就能解决 <wxs ...
- 学习cesium,关于图层界面的切换
最近学习cesium的3D引擎,有关图层切换的例子比较少,在官网上看见了一些例子加以自己的理解.投机了一种近似于图层切换的效果. 这种图层切换每次点击按钮时,会把其他的数据和实体给删除.然后再创建或加 ...
- flask开发环境
1. 创建虚拟环境flask_py3 虚拟环境是一个互相隔离的目录 mkvirtualenv flask_py3 2.安装flask包 pip install flask==0.10.1 其他:导入f ...
- JavaSpring【七、AspectJ】
AspectJ 概念 @AspectJ类似纯Java注解的普通Java类 Spring可以使用AspectJ来作为切入点 AOP在运行时仍是纯SpringAOP,对AspectJ无依赖 配置: 对@A ...
- 反编译DLL并修改DLL中的内容
使用场景:针对当前用户因不愿意进行软件版本升级,但又希望可以解决当前问题,此时可以考虑通过反编辑DLL进行修改内容,然后重新生成新的DLL 操作步骤: 1.首先使用ILSpy.exe反编译DLL,查看 ...
- LoadRunner(5)
一.在线综合场景测试:号称能更真实模拟实际生产环境 又称为:混合交易测试 (交易就是事务 Transaction) 1.三要素: 1)多用户:根据需求指定VU数 压力的来源 2)多任务:根据需求结合多 ...
- Python&Selenium 数据驱动【unittest+ddt+xml】
一.摘要 本博文将介绍Python和Selenium做自动化测试的时候,基于unittest框架,借助ddt模块使用xml文件作为数据文件作为测试输入 二.xml文件 <?xml version ...
- C# MVC 视图 计算某一个列的总和
需求:在需要计算每一列的总和显示在最后一行 eg; AA BB CC 1 2 3 1 2 3 SUM 2 4 6 大概是酱紫 我用的是mvc Mo ...