游客 Signup | Login
中文 | En

3236 - 习题3-2 计算存款利息(3)

计算存款利息。有1000元,想存5年,如果先存一次3年定期,再存一次2年定期,计算到期后的本息和(结果精确到分)。

1年期本息和计算方法:p=1000*(1+r)

n年期本息和计算方法:p=1000*(1+n*r)

存n次1年期的本息和计算方法:p=1000*(1+r)n

活期存款本息和:p=1000*(1+r/4)4n

其中1000*(1+r/4)是一个季度的本息和。

2014年10月,银行存款利息如下:

1年期定期存款利息为3.00%

2年期定期存款利息为3.75%

3年期定期存款利息为4.25%

5年期定期存款利息为4.75%

活期存款利率为0.36%(活期存款每一季度结算一次利息)。

Input

Output

p=5年后的本息和,结果精确到分,注意末尾的换行,

Examples

Input

Output

p=1212.06

Solution C

#include<stdio.h>
#include<stdlib.h>
int main()
{
	float p0=1000,r1=0.0375,r2=0.0425,p1,p;
	p1=p0*(1+3*r2);
	p=p1*(1+2*r1);
	printf("p=%7.2f\n",p);
	
	return 0;
}

Solution C++

#include<iostream>
using namespace std;
int main()
{

cout<<"p=1212.06"<<endl;
}
Time Limit 1 second
Memory Limit 128 MB
Discuss Stats
上一题 下一题