描述
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
 
 
 
#include <stdio.h>

const static int CAL_MONTH_COUNT = 12;

int main()
{
    float result = 0;
    float readLen = CAL_MONTH_COUNT;
    while (readLen>0)
    {
        float currValue = 0;
        scanf("%f",&currValue);
        getchar();
       
        result += currValue;
       
        --readLen;
    }
   
    printf("%.2f\n",result/CAL_MONTH_COUNT);
   
    return 0;

}
 
 
这段英文大差不差的知道大概是求个平均值,对输出结果提出了要求。
 

20-语言入门-20-Financial Management的更多相关文章

  1. ElasticSearch 2 (20) - 语言处理系列之如何开始

    ElasticSearch 2 (20) - 语言处理系列之如何开始 摘要 Elasticsearch 配备了一组语言分析器,为世界上大多数常见的语言提供良好的现成基础支持. 阿拉伯语.亚美尼亚语,巴 ...

  2. 1059 C语言竞赛 (20 分)

    题目:1059 C语言竞赛 (20 分) C 语言竞赛是浙江大学计算机学院主持的一个欢乐的竞赛.既然竞赛主旨是为了好玩,颁奖规则也就制定得很滑稽: 0.冠军将赢得一份“神秘大奖”(比如很巨大的一本学生 ...

  3. 【南阳OJ分类之语言入门】80题题目+AC代码汇总

    小技巧:本文之前由csdn自动生成了一个目录,不必下拉一个一个去找,可通过目录标题直接定位. 本文转载自本人的csdn博客,复制过来的,排版就不弄了,欢迎转载. 声明: 题目部分皆为南阳OJ题目. 代 ...

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

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

  5. Financial Management[POJ1004]

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

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

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

  7. 《C语言入门1.2.3—一个老鸟的C语言学习心得》—清华大学出版社炮制的又一本劣书及伪书

    <C语言入门1.2.3—一个老鸟的C语言学习心得>—清华大学出版社炮制的又一本劣书及伪书 [薛非评] 区区15页,有80多个错误. 最严重的有: 通篇完全是C++代码,根本不是C语言代码. ...

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

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

  9. c语言入门教程 / c语言入门经典书籍

    用C语言开始编写代码初级:C语言入门必备(以下两本书任选一本即可) C语言是作为从事实际编程工作的程序员的一种工具而出现的,本阶段的学习最主要的目的就是尽快掌握如何用c语言编写程序的技能.对c语言的数 ...

  10. [POJ] #1004# Financial Management : 浮点数运算

    一. 题目 Financial Management Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 173910   Acc ...

随机推荐

  1. iOS中的堆(heap)和栈(stack)的理解

    操作系统iOS 中应用程序使用的计算机内存不是统一分配空间,运行代码使用的空间在三个不同的内存区域,分成三个段:“text segment “,“stack segment ”,“heap segme ...

  2. 理解PHP 依赖注入|Laravel IoC容器

    看Laravel的IoC容器文档只是介绍实例,但是没有说原理,之前用MVC框架都没有在意这个概念,无意中在phalcon的文档中看到这个详细的介绍,感觉豁然开朗,复制粘贴过来,主要是好久没有写东西了, ...

  3. matlab实现雅可比、高斯塞德尔、后项误差计算

    稀疏矩阵生成: function [a, b] = aparsesetup(n) e = ones(n, 1); n2 = n / 2; a = spdiags([-e 3*e -e], -1:1, ...

  4. left edge algorithm.

    今天在看GCPC 2013 的时候,遇到了一个简单的任务分配的题目. 即给定一系列任务[l,r], 每个人不能同时做两个, 最多需要几个人来完成? 这个问题的一个标准解法是对所有l,r排序,然后遇到l ...

  5. eclipse下如何关联android-support-v4.jar源码

    一.首先导入jar包 如果android-support-v4.jar包在libs目录下,先将它移除.然后点选中项目右键 --->properties-->javabuildpath--& ...

  6. bnuoj 16493 Just Pour the Water(矩阵快速幂)

    http://www.bnuoj.com/bnuoj/problem_show.php?pid=16493 [题解]:矩阵快速幂 [code]: #include <cstdlib> #i ...

  7. android studio 完整安装教程,已完全实践过

    直接去官方下载包含android sdk的安装包(约813M),之前就是没有包含android sdk (约214M)所以需要另外从dl-google下载android sdk,太麻烦了.下面就一步步 ...

  8. java集合类(二)List学习

    接上篇  java集合类(一) List接口继承了Collection接口和Iterable接口,即同样含有Collection和 Iterable的特性,还有方法,其基本方法有: 1)有关添加: b ...

  9. 【Leetcode】 - Single Number II

    Problem Discription: Suppose the array A has n items in which all of the numbers apear 3 times excep ...

  10. mysql数据库备份及恢复命令mysqldump,source的用法

    还原一个数据库:mysql -h localhost -u root -p123456 www<c:/www.sql 备份一个数据库:mysqldump -h localhost -u root ...