作者:郁小草__ | 来源:互联网 | 2024-09-26 11:29
#include#includeintmain(){printf(floorof2.3is%d\n,(int)floor(2.3));printf(floorof
#include
#include
int main ()
{
printf ("floor of 2.3 is %d\n", (int )floor (2.3) );
printf ("floor of 2.6 is %d\n", (int)floor (2.6) );
printf ("floor of -2.3 is %d\n", (int)floor (-2.3) );
printf ("floor of -2.6 is %d\n", (int )floor (-2.6) );
printf ("floor of 2.3 is %d\n", (int )ceil (2.3) );
printf ("floor of 2.6 is %d\n", (int )ceil (2.6) );
printf ("floor of -2.3 is %d\n", (int )ceil (-2.3) );
printf ("floor of -2.6 is %d\n", (int)ceil (-2.6) );
printf("%d",(int )-2.3);
return 0;
}
向下向上去整函数