poj 1004 -- Financial Management

Financial Management
Time Limit: 1000MS Memory Limit: 10000K
Total Submissions: 182912 Accepted: 69109

Description

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.

Input

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.

Output

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.

Sample Input

100.00
489.12
12454.12
1234.10
823.05
109.20
5.27
1542.25
839.18
83.99
1295.01
1.75

Sample Output

$1581.42
这题就只是求12个月的平均数,但有一个坑:使用g++编译要使用float,不能使用double,或者直接使用c++编译,float,double均可。

#include <cstdio>

int main()
{
    //freopen("test.txt","r",stdin);
    double sum=0;
    for(int i=0;i<12;i++)
    {
        double money;
        scanf("%lf",&money);
        sum+=money;
    }
    printf("$%.2lf\n",sum/12);
    return 0;
}

《宾馆客房管理系统》是一个基于C#与MySQL的项目,旨在帮助学习者掌握数据库管理和系统开发知识。该项目通过完整代码实现,将编程技术应用于宾馆客房管理的实际业务场景。 C#是微软开发的面向对象编程语言,广泛用于Windows应用程序开发。在本项目中,C#用于构建用户界面、处理业务逻辑以及与数据库交互。它拥有丰富的类库,便于开发复杂图形用户界面(GUI),并通过ADO.NET组件实现与MySQL数据库的连接。MySQL是一种流行的开源关系型数据库管理系统(RDBMS),常用于Web应用程序,用于存储客房、预订、客户等核心数据。通过SQL语句,开发者可对数据进行增、删、改、查操作。系统中可能涉及“客房表”“预订表”“客户表”等,包含客房编号、类型、价格、预订日期等字段。 数据库连接是系统的关键部分。C#通过ADO.NET的SqlConnection类连接MySQL数据库,连接字符串包含服务器地址、数据库名称、用户名和密码。用户下载项目后,需根据本地环境修改连接字符串中的用户名和密码。系统主要功能模块包括:客房管理,可展示、添加、修改、删除客房信息;预订管理,处理预订的查看、新增、修改和取消;客户管理,存储和管理客户个人信息;查询功能,支持按客房类型、价格范围、预订日期等条件查询;报表和统计功能,生成入住率、收入统计等报表辅助决策。开发者需编写C#方法对应数据库操作,同时设计直观易用的界面,方便用户完成预订流程。项目中的MySQL文件可能是数据库脚本或配置文件,包含建表、数据填充及权限设置等内容,用户需在本地测试前运行脚本设置数据库环境。 总之,该系统结合C#和MySQL,为学习者提供了一个涵盖数据库设计、业务逻辑处理和界面开发的综合实践案例,有助于提升开发者在数据库应用和系统集成方面的能力。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值