求教问题,为什么dimensional weight (pounds)输出值为25311?正确答案应为6。
/* Computes the dimensional weight of a 12" × 10" × 8" box */#include
int main(void)
{
int height = 8, length = 12, width = 10, volume, weight;
printf("Dimensions: %dx%dx%d\n", length, width, height);
printf("Volume(cubic inches): %d\n", height * length * width);
printf("Dimensional weight (pounds): %d\n", (volume + 165 ) / 166);
return 0;
}