模拟题,注意:

1、那两个贷款都是向银行贷的,就是两个贷款的总额不能超过70%,就算公积金贷款能贷也不行,我开始的时候以为公积金贷款是向公司借的,,欺负我这些小白嘛....

2、最坑的地方 *0.7是wa的,要*7/10

3、那个公式的-1不是减在月份上的,是减在总体上的

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
#define inf (0x3f3f3f3f)
typedef long long int LL; #include <iostream>
#include <sstream>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <string>
int price_house,max_fund;
double rate_bussiness,rate_fund;
int year;
double calc (int all,double rate,int mon)
{
all *= ;
mon *= ;
rate /= ;
rate /= ;
double ans = all*(rate*pow(+rate,mon*1.0))/(pow(+rate,mon*1.0)-);
return ans;
}
void work ()
{
//cout<<calc(107,rate_bussiness,20)<<endl;
int total = (int)floor(0.7*price_house);
int pr_begin=;
double pr_month=;
if (total >= max_fund)
{
total -= max_fund;
pr_month += calc(max_fund,rate_fund,year);
pr_month += calc(total,rate_bussiness,year);
pr_begin = price_house - total - max_fund;
printf ("%d %0.0f\n",pr_begin,pr_month);
return ;
}
else
{
pr_month += calc(total,rate_fund,year);
pr_begin = price_house - total;
printf ("%d %0.0f\n",pr_begin,pr_month);
}
return ;
}
int main()
{
#ifdef local
freopen("data.txt","r",stdin);
#endif
while(scanf("%d%d%lf%lf%d",&price_house,&max_fund,&rate_bussiness,&rate_fund,&year)!=EOF)
work();
return ;
}

最新文章

  1. UVa #11582 Colossal Fibonacci Numbers!
  2. IE7下z-index混乱问题(转)
  3. a标签创建超链接,利用a标签创建锚点
  4. Flex布局总结
  5. Redis配置以及通过C#访问小试
  6. (easy)LeetCode 217.Contains Duplicate
  7. CentOS6.4安装Smokeping节点监控软件
  8. (转)jquery的html,text,val
  9. html系列教程--DOCTYPE a area
  10. IntelliJ IDEA对开发者的三大诱惑
  11. Dapper.Contrib——更加优雅地使用Dapper进行增删改查
  12. MysqL错误之_ERROR! MySQL server PID file could not be found!
  13. 2016弱校联盟十一专场10.3 We don't wanna work!
  14. Linux提示字符设置
  15. imu_tk标定算法
  16. angular2在ts中使用transform转换时间格式
  17. django中利用FastDFS来上传图片的流程
  18. Centos7 Minimal 安装后 初始化配置
  19. Java理论学时第一节。课后作业。
  20. 001.FTP简介及相关文件

热门文章

  1. Python:sample函数
  2. 【转】 Pro Android学习笔记(三四):Menu(5):动态菜单
  3. 图解Stm32使用jlink下载程序时jtag接口(SW和JTAG模式)的简化方法
  4. 树莓派 Learning 002 装机后必要的操作 --- 09 root用户 密码
  5. xgene:疾病相关基因,耳聋,彩色,老年痴呆,帕金森
  6. 【NLP】中文分词:原理及分词算法
  7. ZOJ 3939 The Lucky Week (暴力找规律)
  8. 经典DP 嵌套矩形 (南洋理工ACM—16)
  9. 【idea-部署web项目】
  10. .net core webapi +ddd(领域驱动)+nlog配置+swagger配置 学习笔记(2)