c语言:计算存款利息
程序员文章站
2022-04-12 21:12:53
程序:
#include
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 请按任意键继续. . .