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. MVC路径无匹配或请求api版本过低时处理

    解决方案:RequestMappingHandlerMapping中重写handleNoMatch方法,springMVC和springboot中配置无区别. 另: 1.可搭配advice处理抛出的异 ...

  2. Hash Table Implementation in C++

    对于字符串,所用的hash函数为: size_t _Hash_bytes(const void* ptr, size_t len, size_t seed) { static const size_t ...

  3. nginx::certbot制作免费证书

    环境 Ubuntu8.04apt-get update apt-get install software-properties-common add-apt-repository ppa:certbo ...

  4. linux-pclint代码检测

    win10.ubuntu16.04, vs2017. 1.安装pc-lint到C盘. 2.将linux下的usr整个目录打包拷贝到win10某盘下. 3.获取lint检测linux c++ 代码的宏参 ...

  5. Logstash 入门

    一.简介 Logstash 是开源的服务器端数据处理管道,支持从不同来源采集数据,装换数据,并将数据发送到不同的存储库中. Logstash 项目诞生于 2009 年 8 月 2 日.其作者是世界著名 ...

  6. html简介(1)

    HTML 是用来描述网页的一种语言. HTML 指的是超文本标记语言: HyperText Markup Language HTML 不是一种编程语言,而是一种标记语言

  7. JVM(3) 垃圾收集器与内存分配策略

    一.垃圾收集的概念 在Java虚拟机运行时数据区中程序计数器.虚拟机栈和本地方法栈3个区域随线程而生,随线程而灭:栈中的栈帧随着方法的进入和退出而有条不紊地执行着出栈和入栈操作,每一个栈帧中分配多少内 ...

  8. Java基础(三十四)String、StringBuffer类和数据缓冲区Buffer类

    一.String类 1.创建字符串对象 创建字符串对象有两种方法:直接用“=”或者使用“new String(...)” String aStr = "TMZ"; String b ...

  9. windows下搭建开发环境

    PHP集成开发环境有很多,如XAMPP.AppServ......只要一键安装就把PHP环境给搭建好了.但这种安装方式不够灵活,软件的自由组合不方便,同时也不利于学习.所以我还是喜欢手工搭建PHP开发 ...

  10. 20191106-使用pyttsx对文本进行语音输出

    实现pyttsx文字转语音的开源库调用 参考: 1.  https://blog.csdn.net/liuyubo23/article/details/83990532 2.  https://www ...