先用浮点型加,在取整
#include<stdio.h> int main() { float a=1.1, b=1.2, c=1.3; printf("%f ", a + b + c); printf("%d", (int)(a + b + c)); }