#include<stdio.h> int main() { double x; printf("enter x\n"); scanf("%lf",&x);//把\n去掉 printf("x=%f\n",x); x=x*100; x=x+0.5; x=(long)x; x=x/100; printf("x=%f\n",x); return 0; }