1 #include<stdio.h> 2 #include<stdlib.h> 3 //判断一个数是不是整数,如果是,返回1,否则,返回0 4 int fun(double num) 5 { 6 return num==(int)num; 7 } 8 int main() 9 { 10 printf("%d\n",fun(3.53221)); 11 printf("%d\n",fun(12544.534352)); 12 printf("%d\n",fun(1233)); 13 system("pause"); 14 return 0; 15 }