首页 > 中学考试杂题 > 题目详情
c语言 为什么运行没结果..求大神指导..怎么修改,编写程序拆分输入实数的整数部分与小数部分..#include int
题目内容:
c语言 为什么运行没结果..求大神指导..怎么修改,编写程序拆分输入实数的整数部分与小数部分..
#include
int main(void)
{double x,*intpart,*fracpart;
void splitfloat (double x,double *intpart,double *fracpart);
printf(" ");
scanf("%lf",&x);
printf("The intpart is:%lf\t\n",*intpart);
printf("The fracpart is:%.6lf\t ",*fracpart);
return 0;}
void splitfloat (double x,double *intpart,double *fracpart)
{
*intpart=(int)x;
*fracpart=x-*intpart;}
c语言 为什么运行没结果..求大神指导..怎么修改,编写程序拆分输入实数的整数部分与小数部分..
#include
int main(void)
{double x,*intpart,*fracpart;
void splitfloat (double x,double *intpart,double *fracpart);
printf(" ");
scanf("%lf",&x);
printf("The intpart is:%lf\t\n",*intpart);
printf("The fracpart is:%.6lf\t ",*fracpart);
return 0;}
void splitfloat (double x,double *intpart,double *fracpart)
{
*intpart=(int)x;
*fracpart=x-*intpart;}
#include
int main(void)
{double x,*intpart,*fracpart;
void splitfloat (double x,double *intpart,double *fracpart);
printf(" ");
scanf("%lf",&x);
printf("The intpart is:%lf\t\n",*intpart);
printf("The fracpart is:%.6lf\t ",*fracpart);
return 0;}
void splitfloat (double x,double *intpart,double *fracpart)
{
*intpart=(int)x;
*fracpart=x-*intpart;}
本题链接: