C语言12
作者:互联网
#include<stdio.h>
void splitfloat(float x,int *intpart,float *fracpart);
int main(void)
{
float x,fracpart;
int intpart;
scanf("%f",&x);
splitfloat(x,&intpart,&fracpart);
printf(“intpart=%d\n”,intpart);
printf(“fracpart=%f\n”,fracpart);
}
void splitfloat(float x,int *intpart,float *fracpart)
{
*intpart=(int)x;
*fracpart=x-*intpart;
}
标签:12,int,void,float,C语言,splitfloat,intpart,fracpart 来源: https://blog.csdn.net/Zhu_Yanci/article/details/118735738