编写一个程序,根据存款本金money、存款年数year和年利率rate来计算利息

2025-01-18 14:53:10
推荐回答(1个)
回答1:

#include

void main()
{int money,year;
float rate,interest;
printf("input money:\n");
scanf("%d",&money);
printf("input rate:\n");
scanf("%f",&rate);
printf("input year:\n");
scanf("%d",&year);
interest=money*(1+rate)*year-money;
printf("the interest is:%.2f\n",interest);
}

有问题再找我