① C語言計算貸款還款額怎麼做
#include<stdio.h>
#include<math.h>
intmain(){
inttotal,year;
doublerate_year;
scanf("%d%d",&total,&year);
if(year<=1)
rate_year=0.03;
elseif(year<=5)
rate_year=0.04;
elseif(year<=10)
rate_year=0.05;
else
rate_year=0.06;
doublerate=rate_year/12;
printf("%lf ",total*pow(rate+1,year*12)*rate/(pow(rate+1,year*12)-1));
return0;
}
② C語言題:某客戶為購房辦理商業貸款,選擇了按月等額本息還款方式,計算公式如下。在貸款本金(loan
#include<stdio.h>
floatcal_power(floatx,intn)
{
floatp=1.0;
while(n>0){
p=p*x;
n--;
}
returnp;
}
floatcal_money(intloan,floatrate,intmonth)
{
doubletmp;
tmp=cal_power(1+rate,month);
returnloan*rate*tmp/(tmp-1);
}
intmain(void)
{
intloan,year,month;
floatmoney,rate;
printf("Enterloan:");
scanf("%d",&loan);
printf("Enterrate:");
scanf("%f",&rate);
for(year=5;year<=30;year++){
month=12*year;
money=cal_money(loan,rate,month);
printf("money(%d,%d)=%.0f ",loan,year,money);
}
return0;
}
③ C語言編程計算還貸後剩餘的貸款金額
void mian(){
float m,m1;
printf("請輸入上月所剩貸款金額:\n");
scanf("%lf",&m);
printf("輸入本月還款金額:");
scanf("%lf",&m1);
m=m+0.005*m-m1;
printf("本月還款後剩餘貸款金額:%.2f ",m);
}
④ 有關銀行貸款還貸的c語言程序
這個沒有必要。各家國有銀行的網銀和網站上都有現實利率的貸款計算器。利率隨時更新。很方便的。
⑤ C語言編程題,求解題思路!
#include <stdlib.h>
#include <stdio.h>
int main()
{
int P, N;
double R;
printf("input data: ");
scanf("%d;%d;%lf", &P, &N, &R);
printf("P = %d\n", P);
printf("N = %d\n", N);
printf("R = %0.6f\n", R);
double avg = (double)P / N;
double ret = 0;
printf("[");
for (size_t i = 0; i < N; ++i)
{
double money = avg + (P - ret) * R;
ret += avg;
printf("%.2f", money);
if (i < N - 1)
printf(", ");
}
printf("]\n");
return 0;
}
⑥ 請教C語言編程中計算還貸後剩餘的貸款金額的詳細答案, 最好能夠說明一下每個步驟!
#include <stdio.h>
#define A 一月還款金額
#define B 二月還款金額
#define C 三月還款金額
#define D 利潤轉化後的百分比
int main()
{
float p, c, x, A, B,C,D;
printf("輸入貸款金額");
scanf_s(" %f",&p);
printf("輸入獲得利潤");
scanf_s(" %f", &c);
printf("輸入每月還款金額");
scanf_s(" %f", &x);
D = c / 100.0f / 12;
A = (p - x) + p * D;
printf("\n一月還款後金額: $%.2f\n", A);
B = (A - x) + A * D;
printf("二月還款後金額: $%.2f\n", B);
C = (B - x) + B * D;
printf("三月還款後金額: $%.2f\n", C);
return 0;
}
⑦ 一道c語言編程題,求解題思路
你所謂的暴力方法,能不能貼出偽代碼
你覺得暴力方法有什麼問題,所以才要求更好的方法?
⑧ C語言中的計算還清貸款月數的公式含義
#include <stdio.h> main() { int i,j,n; float sum=0; scanf("%d",&n); for(i=1;i<=n;i++) { int s=1; for(j=1;j<=i;j++) { s*=j; } sum+=1.0/s; } printf("1/1!+1/2!+1/3!……+1/n!=%f\n",sum); }
⑨ c語言: 計算還款年限-月還款額
#include<stdio.h>
#include<math.h>
intmain()
{
inti,month;
doubleloan,rate,money,molecular,denominator;
printf("請輸入貸款本金和月利率: ");
scanf("%lf%lf",&loan,&rate);
money=0;
printf("還款年限-月還款額表: ");
for(i=5;i<=30;i++)
{
month=i*12;
molecular=rate*pow((1+rate),month);
denominator=pow((1+rate),month)-1;
money=loan*(molecular/denominator);
printf("貸款%d年的月還款額為%.4f ",i,money);
}
return0;
}