69,371
社区成员
发帖
与我相关
我的任务
分享
int main()
{
double f;
long n;
int nums;
char c;
printf("pls enter ur double:");
nums = scanf("%lf", &f);
if (nums == 1)
{
if (f < 0)
{
printf("-");
f = -f;
}
n = (long)f;//整数部分
printf("is:", NUM);
integer(n);
printf(".");
decimal(f - n);//小数部分的转换
}
else
{
scanf("%c", &c);
printf("%c: ", c);
integer(c);
}
printf("\n");
system("pause");
return 0;
}