时间限制:1 秒

内存限制:32 兆

特殊判题:否

提交:585

解决:331

题目描述:

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.

输入:

Each case 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.

输出:

For each case, 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
来源:
2010年北京大学计算机研究生机试真题
答疑:
解题遇到问题?分享解题心得?讨论本题请访问:http://t.jobdu.com/thread-7871-1-1.html
#include<stdio.h>
int main()
{int i;float month[12] ;float sum = 0;while(scanf("%f",&month[0]) != EOF){sum = month[0];for(i = 1; i < 12; i++){scanf("%f",&month[i]);//printf("%.2f\n",month[i]);sum += month[i];}printf("$%.2f\n",sum/12);}return 0;
}

scanf输入float时用%f,double时用%lf!

题目1141(1148):Financial Management相关推荐

  1. 财务管理c语言oj,九度OJ 1141:Financial Management (财务管理) (平均数)

    时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:939 解决:489 题目描述: Larry graduated this year and finally has a job. He's ...

  2. Introduction to Financial Management

    Recently,i am learning some useful things about financial management by reading <Essentials of Co ...

  3. NUC1011 Financial Management【数学计算+水题】

    Financial Management 时间限制: 1000ms 内存限制: 10000KB 问题描述 Larry graduated this year and finally has a job ...

  4. SAP FICO - Functional Area/ Financial Management Area(FM Area)

    Functional Area 是功能范围,是一个对基于活动发生的费用排序的组织单位. 例如:生产,管理,销售,研发等. 功能范围允许建立符合要求的财务报表. 如果该组织遵循销售成本会计,那必须在SA ...

  5. HFM student Hyperion Financial Management

    HFM student  Hyperion Financial Management https://docs.oracle.com/cd/E57185_01/index.htm <Oracle ...

  6. Oracle Hyperion Financial Management工具介绍及脚本使用

    oracle HFM工具介绍及脚本使用 一.oracle HFM工具介绍 Oracle Hyperion Financial Management提供了财务整合和报告功能,使您能够快速整合和报告财务结 ...

  7. 题目1148:Financial Management

    /*** 题目描述:Larry graduated this year and finally has a job. He's making a lot of money, but somehow n ...

  8. ZOJ Problem Set - 1048 Financial Management

    我承认这是一道水的不能再水的题,今天一下就做到了,还是无耻的帖上来吧 #include <stdio.h>int main() {double sum=0;for(int i=1;i< ...

  9. ZOJ 1048|POJ 1004|HDU1064 Financial Management

    https://zoj.pintia.cn/problem-sets/91827364500/problems/91827364547 题解: C++版本一 /* *@Author: STZG *@L ...

最新文章

  1. GDAL2.1.1库在Ubuntu14.04下编译时遇到的问题处理方法
  2. php发布商品信息逻辑,php – 逻辑思考一个数据库结构:为用户发布的东西添加“标签” – 一个单独的表或……?...
  3. 了解HTML 元素分类
  4. DFT实训教程笔记4(bibili版本)- ATPG
  5. Windows 钩子的使用
  6. 摄像头自动曝光相关基础知识
  7. mysql流程控制_Mysql之流程控制结构
  8. java如何对List集合中的元素进行排序(请收藏)
  9. 烽火服务器怎么进入bios系统,装机高手告诉你如何进入bios
  10. 为什么ConcurrentHashMap不允许插入null值?
  11. vue2.0中watch总结:普通监听和深度监听
  12. AD-批量启用账户命令 Enable-adaccount
  13. springboot web项目_SpringBoot 源码解析 (一):SpringBoot核心原理入门
  14. 网络地址16777343是什么地址?
  15. 什么是软件质量管理的底层逻辑?
  16. ffmpeg录制麦克风声音和pc内部声音(如播放歌曲)---混音--修正
  17. Unity实现鼠标控制摄像机围绕中心点的旋转和缩放
  18. 《区块链基础知识25讲》-第七讲-双花问题
  19. 培训html源码,前端培训——html源码笔记
  20. 多线程 - voliate 关键字

热门文章

  1. C语言是不是世界上最好的编程语言?真的永远不会过时吗?
  2. 2020-02-06
  3. subprocess句柄无效
  4. python3-网络数据下载
  5. 电影 | 治愈心灵必看的3部电影
  6. C#和服务器上虚拟机内PLCSIM通信
  7. npm WARN deprecated core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for
  8. 写给程序员的 MySQL 面试高频 100 问,看完吊打面试官!
  9. RFID开发 IPJ标签信息识别以及数据存储
  10. 星外服务器显示,星外虚拟主机管理系统关于权限的综合说明