int mood=4; float speed=1.0+mood/5; speed=1.0...后面的整型除以整型是取整所以为0 可以改成 float speed=1.0+mood/5.0f; 或float speed=1.0+mood*0.2;