#includefloat fun(double h){ return (int)((h+0.005)*100)/(float)100;}int main(void){//测试一下…… printf("%.2f %.2f\n",fun(0.123456),fun(567.34579)); return 0;}