72.Financial Management
- 描述
- 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.
- 输入
- 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.
- 输出
- 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.
- 样例输入
-
100.00
489.12
12454.12
1234.10
823.05
109.20
5.27
1542.25
839.18
83.99
1295.01
1.75 - 样例输出
-
1581.42
1 #include<stdio.h>
2 int main(int argc, char const *argv[]) {//char *argv[]是一个字符数组,其大小是int argc,主要用于命令行参数argv[]
3 double sum = 0, a;
4 int n = 12;
5 while(n--) {
6 scanf("%lf", &a);//%lf双精度浮点型数据(也就是double)的输入格式控制符
7 sum += a;
8 }
9 printf("%.2lf\n", sum/12);
10 return 0;
11 }
72.Financial Management的更多相关文章
- poj 1004:Financial Management(水题,求平均数)
Financial Management Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 126087 Accepted: ...
- Financial Management[POJ1004]
Financial Management Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 179458 Accepted: ...
- 练习英语ing——[POJ1004]Financial Management
[POJ1004]Financial Management 试题描述 Larry graduated this year and finally has a job. He's making a lo ...
- Financial Management 分类: POJ 2015-06-11 10:51 12人阅读 评论(0) 收藏
Financial Management Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 164431 Accepted: ...
- Introduction to Financial Management
Recently,i am learning some useful things about financial management by reading <Essentials of Co ...
- [POJ] #1004# Financial Management : 浮点数运算
一. 题目 Financial Management Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 173910 Acc ...
- Financial Management
Financial Management 时间限制:3000 ms | 内存限制:65535 KB 难度:1 描述 Larry graduated this year and finally ...
- Financial Management POJ - 1004
Financial Management POJ - 1004 解题思路:水题. #include <iostream> #include <cstdio> #include ...
- UVA 11945 Financial Management 水题
Financial Management Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 acm.hust.edu.cn/vjudge/problem/vis ...
随机推荐
- P6793-[SNOI2020]字符串【广义SAM,贪心】
正题 题目链接:https://www.luogu.com.cn/problem/P6793 题目大意 给出两个长度为\(n\)的字符串,取出他们所有长度为\(k\)的连续子串分别构成两个可重集合\( ...
- 踩坑系列《九》 无法获取实体类xxx对应的表名
话不多说,直接说明原因 类似于 @MapperScan(basePackages = "com.hyxiao.user.mapper") 启动类的mapper扫描注解的导入包正确的 ...
- Radius协议-学习
目录 RFC Radius 协议 Radius-学习 RADIUS协议的主要特征 客户端/服务器模式 安全的消息交互机制 良好的扩展性 AAA介绍 C/S结构 RADIUS在协议栈中的位置 RADIU ...
- nginx访问权限问题
1.问题 server { listen 8011; server_name test.cn; location ~ \.php?.*$ { root /home/zhj/; #fastcgi_pas ...
- Java基础之(十二):数组
数组 数组概述 定义 数组是相同类型数据的有序集合. 数组描述的是相同类型的若干数据,按照一定的先后次序排列组合而成. 其中,每一个数据称作一个数组元素,每个数组元素可以通过一个下标来访问它们. 数组 ...
- 题解 Yet Another Number Sequence
题目传送门 Description 给出 \(n,k\) ,求出: \[\sum_{i=1}^{n} f_i·i^k \] 其中 \(f_i\) 表示斐波拉契第 \(i\) 项.\(n\le 10^{ ...
- 【分享】 一款自用的Anki卡片模板:黄子涵单词卡片 v1
[分享] 一款自用的Anki卡片模板:黄子涵单词卡片 v1 说明 第一代的功能 主要有两部分组成:英文和含义,目前主要是为自己记忆Web前端一些常用的单词而服务 有美美哒背景图,本来想修改为随机背景图 ...
- XSS_Labs靶场通关
XSS-labs靶场(1-20) 开始通关! 0x01 (直接漏洞注入) 反射型xss注入 1.遇到?name=text,尝试参数注入 注入语句: <script>alert('xss ...
- SpringCloud 2020.0.4 系列之服务降级的其他用法与熔断
1. 概述 老话说的好:控制好自己的情绪,才能控制好自己的人生.冲动是魔鬼,冷静才最重要. 言归正传,之前聊了在 Feign 调用时,如何给整个 Feign接口类 增加降级策略. 今天我们来聊一下 H ...
- Noip模拟75 2021.10.12
T1 如何优雅的送分 他说是送分题,我就刚,没刚出来,想到莫比乌斯容斥后就都没推出来 好吧还是不能被恶心的题目,挑衅的语言打乱做题节奏 于是这一场也就没了.... $F(i)$表示$i$的不同质因子集 ...