当前位置: 移动技术网 > IT编程>开发语言>C/C++ > c语言:计算存款利息

c语言:计算存款利息

2018年03月25日  | 移动技术网IT编程  | 我要评论
程序: #include<stdio.h> int main() { float P0=1000,R1=0.0036,R2=0.0225,R3=0.019
程序:
#include<stdio.h>
int main()
{
float  P0=1000,R1=0.0036,R2=0.0225,R3=0.0198,P1,P2,P3 ;
P1 = P0*(1+R1);
P2 = P0*(1+R2);
P3 = P0*(1+R3/2)*(1+R3/2);
printf("P1=%f\nP2=%f\nP3=%f\n",P1,P2,P3);
return 0;
}
结果:
P1=1003.599976
P2=1022.500061
P3=1019.897949
请按任意键继续. . .

 

如您对本文有疑问或者有任何想说的,请点击进行留言回复,万千网友为您解惑!

相关文章:

验证码:
移动技术网