m0_60098601 2021-08-24 11:39 采纳率: 0%
浏览 44

weight = (volume + 165) / 166;,知道165这么来的

#include<stdio.h>
#include<stdlib.h>

int main(void)
{
int height, length, width, volume, weight;

height = 8;//length = 12;//长
width = 10;//宽

//输入箱的高
printf("Enter height of box :\n");
scanf("%d", &height);

//输入箱的长度
printf("Enter length of box :\n");
scanf("%d", &length);

//输入箱的宽
printf("Enter width of box :\n");
scanf("%d", &width);

//体积 = 高 * 长 * 宽
volume = height * length * width;
//重量 = 体积 +165 /166
weight = (volume + 165) / 166;

//体积 = 高 * 长 * 宽
printf("Dimensions : %d*%d*%d\n",length,width,height);
//体积和 
printf("volume(cubic inches): %d\n",volume );
 //重量和
printf("Dimensional weight (pounds) :%d\n", weight);
    
system("pause");
return 0;
  • 写回答

4条回答 默认 最新

  • CSDN专家-sinJack 2021-08-24 11:44
    关注

    weight = (volume + 165) / 166;
    这是求重量的一种计算公式吧。

    评论

报告相同问题?

问题事件

  • 创建了问题 8月24日

悬赏问题

  • ¥15 鼎捷t100或鼎捷E10生产模块与odoo17详细区别和鼎捷t100或鼎捷E10物料清单(BOM)可以在子级的子级在同一界面操作吗
  • ¥50 VS2019,xamarin框架串口调试报错Java.Lang.SecurityException: Exception of type
  • ¥20 QT如何判断QLineF线鼠标划过事件
  • ¥15 关于#phpstorm#的问题:phpstorm编辑工具 光标选中了就会自动复制到粘贴板上 这样我之前复制的内容就失效了
  • ¥15 pychram安装jupyter插件
  • ¥60 悬赏破解越狱iphone4s中360保险箱密码遗忘
  • ¥20 ARKts悬浮窗和快捷方式问题
  • ¥15 linux中nginx服务器提示not found on accelerator,如何解决?(语言-php|操作系统-linux)
  • ¥15 comparecluster没有办法kegg
  • ¥15 远程访问linux主机超时