#include "stdio.h"float area(float base,float heigth){ float a;
a=base*heigth/2;
return a;
}main(){ float c,a,b;
scanf("%f,%f",&a,&b);
c=area(a,b);
printf("%f",c);
getch();
} 我输入 4和5 我得到的结果为什么是 0.00000
程序运行时你的输入有问题没猜错的话你输入的是 4空格5而你的程序要用户输入的是 数字(4)逗号(,)数字(5)你的错误输入导致把0付给b
小问题值得注意,特别是初学者.