#include
#include
int main(void)
{
int i,j,k,l,a;
float y=123.5223454;
/*取到小數點後二位*/
a=(double)(int)(y*100)/100;
/*個別存數字至變數*/
i=(int)y/10;
j=(int)y%10;
k=(int)(y*10)%10;
l=(int)(y*100)%10;
printf("W=%d\n",i);
printf("X=%d\n",j);
printf("Y=%d\n",k);
printf("Z=%d\n",l);
return(0);
}
沒有留言:
張貼留言