c语言浮点数是不精确的,在循环中步长不要使用浮点数,请使用整型float x = 0 f;int r = 0;for(t=1;t<=100;t++){ //例如r+=t;}最后:x = r * 0.01;
可以贴出代码看看,你说的步长是for循环里的吗?