#include "stdafx.h"
#include <math.h>
#include <stdio.h>
int main(int argc, char* argv[])
{
double a = 77.001;
double b = ceil(a);
printf("b = %.3f\n",b);
double c = 77.999;
double d = floor(c);
printf("d = %.3f\n",d);
return 0;
}
输出:
b = 78.000
d = 77.000
Press any key to continue
时间: 2024-10-12 09:02:23