游客 Signup | Login
中文 | En

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

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

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=1237.50

Solution C

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

Solution C++

#include<iostream>
using namespace std;
int main()
{
cout<<"p=1237.50"<<endl;
}
Time Limit 1 second
Memory Limit 128 MB
Discuss Stats
上一题 下一题