错误演示 double a = 9 / 5; //输出1.0 float a = 9 / 5; //输出1.0 正确演示 double a = 9.0 / 5.0; //输出1.8 float a = (float)9.0 / 5.0; //输出1.8