[讨论] 谁能告诉我这代码错在哪里啊
#include <math.h>#include<stdio.h>
main()
{
int n;
double rate;
double capital;
double deposit;
printf("Please enter rate, year, capital:");
scanf("%1f,%d,%1f", &rate, &n, &capital);
deposit = capital * pow(1+rate,n);
printf("deposit = %f\n", deposit);
}
我想用它算存款问题,但输出的不知是几进制的数字还带负号. 我用的是TC2.0