“2021二十一养成好习惯”第一期-1

“2021二十一养成好习惯”第一期-1,第1张

“2021二十一养成好习惯”第一期-1

C语言计算本金和利息之和编写程序

#include 

 #include

int main()

{

double rate,capital;

int year;

printf("please input rate,year,capital:n");

scanf("%lf,%d,%lf",&rate,&year,&capital);

double deposit=capital*pow(1+rate,year);

printf("deposit=%.3lf",deposit);

return 0;

}

运算结果:

please input rate,year,capital:

0.0225,10,1000

deposit=1249.203

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zaji/4750410.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-11-08
下一篇2022-11-08

发表评论

登录后才能评论

评论列表(0条)

    保存