72-Financial Management

内存限制:64MB
时间限制:3000ms
特判: No

通过数:7
提交数:12
难度:1

题目描述:

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~12月的money相加再除以12,得到的结果保留两位小数 C/C++代码实现(AC);
 #include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <stack>
#include <map>
#include <queue>
#include <set> using namespace std;
const int MAXN = ;
int A[MAXN]; int main()
{
double a, cnt = 0.0;
for(int i = ; i < ; ++ i)
{
scanf("%lf", &a);
cnt += a;
}
printf("%.2lf", cnt / 12.0);
return ;
}

nyoj 72-Financial Management (求和 ÷ 12.0)的更多相关文章

  1. 72.Financial Management

    描述 Larry graduated this year and finally has a job. He's making a lot of money, but somehow never se ...

  2. Financial Management 分类: POJ 2015-06-11 10:51 12人阅读 评论(0) 收藏

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

  3. Financial Management[POJ1004]

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

  4. 练习英语ing——[POJ1004]Financial Management

    [POJ1004]Financial Management 试题描述 Larry graduated this year and finally has a job. He's making a lo ...

  5. Financial Management

    Financial Management 时间限制:3000 ms  |  内存限制:65535 KB 难度:1   描述 Larry graduated this year and finally ...

  6. Financial Management POJ - 1004

    Financial Management POJ - 1004 解题思路:水题. #include <iostream> #include <cstdio> #include ...

  7. UVA 11945 Financial Management 水题

    Financial Management Time Limit: 1 Sec  Memory Limit: 256 MB 题目连接 acm.hust.edu.cn/vjudge/problem/vis ...

  8. [POJ] Financial Management

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

  9. POJ 3100 Root of the Problem || 1004 Financial Management 洪水!!!

    水两发去建模,晚饭吃跟没吃似的,吃完没感觉啊. ---------------------------分割线"水过....."--------------------------- ...

随机推荐

  1. PHP array_product

    1.函数的作用:计算数组元素的乘积 2.函数的参数: @params array 3.例子: <?php $input = [false,true]; print_r(array_product ...

  2. Mysql数据类型最细讲解

    文章原创于公众号:程序猿周先森.本平台不定时更新,喜欢我的文章,欢迎关注我的微信公众号. 数据库中事务是最重要的概念之一,所以上篇着重谈了谈数据库中事务的使用,并且举了实例如何在实际开发中去使用事务进 ...

  3. 微信小程序自定义弹窗(可通用)

    效果图 .wxml <cover-view class='mask' wx:if='{{isShow}}'> <cover-view class='modal'> <co ...

  4. idea的tomcat实现热部署遇到的问题

    选择Deployment的时候,要选择exploded结尾的,否则不支持热部署

  5. PHP的陷阱

    PHP的陷阱 写代码的时候有个疑惑,那就是数组下标不存在的时候就会挂掉Undefined Index XXXX,这是对的,但是有时候他就不报错,这又是矛盾的. 请看下面的例子: $json_raw = ...

  6. os模块/sys模块/json/pickle模块/logging模块(day16整理)

    目录 今日内容 os模块 对文件操作 对文件夹此操作 辅助性的 了解 sys模块 json和pickle模块 json模块 pickle模块 logging模块 日志级别 添加设置 自定义配置 今日内 ...

  7. 防抖与节流 & 若每个请求必须发送,如何平滑地获取最后一个接口返回的数据

    博客地址:https://ainyi.com/79 日常浏览网页中,在进行窗口的 resize.scroll 或者重复点击某按钮发送请求,此时事件处理函数或者接口调用的频率若无限制,则会加重浏览器的负 ...

  8. Arthas - Java 线上问题定位处理的终极利器

    前言 在使用 Arthas 之前,当遇到 Java 线上问题时,如 CPU 飙升.负载突高.内存溢出等问题,你需要查命令,查网络,然后 jps.jstack.jmap.jhat.jstat.hprof ...

  9. 零基础攻略!如何使用kubectl和HPA扩展Kubernetes应用程序

    现如今,Kubernetes已经完全改变了软件开发方式.Kubernetes作为一个管理容器化工作负载及服务的开源平台,其拥有可移植.可扩展的特性,并促进了声明式配置和自动化,同时它还证明了自己是管理 ...

  10. python-->二进制的用法

    1.10进制转换为其他进制 方法一:函数 十进制转二进制:bin(10) --> '0b1010' tpye:是字符串类型 0b:表示2进制 十进制转八进制:oct(10) --> '0o ...