#include <stdio.h>
#include <math.h>
float fVal;
float fDecimal;
int iInteger;
//iInteger = (fVal * 10) / 10;
//fDecimal = fVal - iInteger
int main()
{
while(EOF != scanf("%f", &fVal)){
iInteger = (fVal * 10) / 10;
printf("iInteger: %d; fDecimal: %f\n", iInteger, fVal - iInteger);
}
return 0;
}
转载于:https://my.oschina.net/u/572632/blog/295671