int i=0;for(;*(buffer+i)!='.';i++);//统计小数点的位置 if(*(buffer+i+2)=='0')//处理小数点后第二位字符,如果为0,替换为'\0'(buffer+i+2)='\0';printf("四舍五入后,数据变为:%s\n,",buffer);return 0;} float 为单精度浮点型数据,在Turbo C中单精度型占4个字...
include<stdio.h>int main(){float x=12.3456,y=12.344,z=12.303,x1,y1,z1;x1=((int)((x+0.005)*100))/100.0;y1=((int)((y+0.005)*100))/100.0;z1=((int)((z+0.005)*100))/100.0;printf("x1=%g\n",x1);printf("y1=%g\n",y1);printf("z1=%g\n",z1);...
C语言如何实现输出浮点数小数点两位(四舍五入法),但若小数点... lt;stdio.h> mian() { float n; float num1,num2; printf("请输入一个小数:&... printf("/n四舍五入后为:%d",(int)num1); else printf(&qu... 免费无限元宝网页游戏-无限元宝GM服,免费无限元宝网页游戏,送满V 无限元宝〔免...