#includevoid main(){ float x=1.5; printf("%g",x);}试试这个。 %g:选用%f或%e格式中输出宽度较短的一种格式,不输出无意义的0.
对最后输出结果进行强制转换x=(float)(j-100)/2