为啥我输入1,4,1000输出999,而输入1,2,1000输出1000
#include<stdio.h>void main()
{
float a,c,h,e,C;
int n;
printf("请输入a,e,n");
scanf("%f,%f,%d",&a,&e,&n);
h=(e-a)/n;
for(c=h,C=0;c<=n*h;c=c+h)
{C=C+1;}
printf("%f\n",C);
}
2017-10-29 10:32
[此贴子已经被作者于2017-10-29 17:12编辑过]
2017-10-29 17:05
2017-11-10 19:30