这个代码错哪儿?
#include <stdio.h>
int main()
{
double num = 2.5; //定义浮点型变量num并赋值为2.5
int a = (int) num;
num = a;
printf("num的整数部分是%d\n", num);
return 0;
}
#include <stdio.h>
int main()
{
double num = 2.5; //定义浮点型变量num并赋值为2.5
int a = (int) num;
num = a;
printf("num的整数部分是%d\n", num);
return 0;
}
2016-04-15
举报