我喜欢编程的美,我也想让它也喜欢我,也请各位大神们多多指导。

题目:

坚持001——银行利率计算

 

我的作业如下:

#include <stdio.h>
int main()
{
    float money,duration,rate,total;
	printf("Please enter your desposit amount(yuan) and duration(month).\n");
	scanf("%f,%f",&money,&duration);
	if (duration<3) rate=0.003;
	    else if (duration<6) rate=0.0135;
	 	    else if (duration<12) rate=0.015;
	 		    else if (duration<24) rate=0.0175;
	 			    else if (duration<36) rate=0.0225;
	 				    else rate=0.0275;
	total=money+money*rate*duration/12;
	printf("total=%.2f",total);
}

 

相关文章:

  • 2021-07-10
  • 2018-10-06
  • 2022-12-23
  • 2021-11-16
  • 2022-12-23
  • 2021-09-07
猜你喜欢
  • 2021-11-16
  • 2021-09-07
  • 2021-08-01
  • 2021-11-13
  • 2021-09-07
相关资源
相似解决方案