c语言为啥输出老是0?
#include<stdio.h>#include<math.h>intmain(){intyear;doublerate,capital,deposit,a,b;pri...
#include<stdio.h>
#include<math.h>
int main()
{
int year;
double rate, capital, deposit, a, b;
printf("Please enter rate, year, capital\n");
scanf("%lf,%d,%lf", &rate, &year, &capital);
a = 1 + rate;
b = pow(a,year);
deposit = capital * b;
printf("deposit=%.3f\n", deposit);
return 0;
}
deposi输出就是0.000不知道为啥,纯小白一个,求助! 展开
#include<math.h>
int main()
{
int year;
double rate, capital, deposit, a, b;
printf("Please enter rate, year, capital\n");
scanf("%lf,%d,%lf", &rate, &year, &capital);
a = 1 + rate;
b = pow(a,year);
deposit = capital * b;
printf("deposit=%.3f\n", deposit);
return 0;
}
deposi输出就是0.000不知道为啥,纯小白一个,求助! 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询