编写一个简化的房贷计算器程序,输入房价总金额、首付比例、贷款年限和贷款年利率,计算并显示出首付金额和每月还款金额。假设贷款的每月还款金额用用如下计算方法:每月还款金额=((贷款金额×年利率×贷款年限)+贷款金额)/(贷款年限×12)
1个回答
关注
展开全部
#includeint main(){ double totalAmount,downPaymentRate,yearRate,downPayment,monthPayment; int loanYears; printf("请输入房价总金额:\n"); scanf("%lf",&totalAmount); printf("请输入首付比例:\n"); scanf("%lf",&downPaymentRate); printf("请输入贷款年限:\n"); scanf("%d",&loanYears); printf("请输入贷款年利率:\n"); scanf("%lf",&yearRate); downPayment = totalAmount * downPaymentRate; monthPayment = (totalAmount * yearRate * loanYears) / (loanYears * 12); printf("首付金额为:%.2lf\
咨询记录 · 回答于2022-12-20
编写一个简化的房贷计算器程序,输入房价总金额、首付比例、贷款年限和贷款年利率,计算并显示出首付金额和每月还款金额。假设贷款的每月还款金额用用如下计算方法:每月还款金额=((贷款金额×年利率×贷款年限)+贷款金额)/(贷款年限×12)
#includeint main(){ double totalAmount,downPaymentRate,yearRate,downPayment,monthPayment; int loanYears; printf("请输入房价总金额:\n"); scanf("%lf",&totalAmount); printf("请输入首付比例:\n"); scanf("%lf",&downPaymentRate); printf("请输入贷款年限:\n"); scanf("%d",&loanYears); printf("请输入贷款年利率:\n"); scanf("%lf",&yearRate); downPayment = totalAmount * downPaymentRate; monthPayment = (totalAmount * yearRate * loanYears) / (loanYears * 12); printf("首付金额为:%.2lf\
你这个答案不完整啊,你看看最后面那里
不好意思,输入字数有限
我试试
可以再问你一下吗?都该怎么输出啊?房价总金额任何数字都可以吗?还有那个首付比例该怎么写
数值就是阿拉伯数字,首付比例百分比
什么情况
已赞过
评论
收起
你对这个回答的评价是?