#include <stdio.h>
#include <math.h>
int main()
{
double a, b, c, p;
scanf("%1f%1f%1f", &a, &b, &c);
p = (a+b+c)/2;
printf("%.3f", sqrt(p*(p-a)*(p-b)*(p-c)));
return 0;
}
scanf("%lf,%d,%lf", &rate, &year, &capital);
你的代码里输入格式是%lf,%d,%lf,中间有逗号,所以输入的时候也要有逗号
估计你输入的时候没加逗号(注意是西文逗号),而是用空格分隔的,要不加逗号用空格分隔的话,就把%lf,%d,%lf中间的逗号去掉,这样就可以用空格分隔输入了
我试着运行了下:
年化15%,5年翻倍,没错
温馨提示:答案为网友推荐,仅供参考
第1个回答 2020-09-30
你输入3个3试试 还是0??
你上面“%lf%lf%lf”输入有误,改一下 , 是LF
你上面“%lf%lf%lf”输入有误,改一下 , 是LF