#include <stdio.h> int main() { double num = 2.51; //定义浮点型变量num并赋值为2.5 int nun= (int)num; printf("num的整数部分是%d\n", nun); return 0; }
num-(int)num