标题:求大佬帮忙改错一下。
只看楼主
林坤
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2022-11-19
结帖率:0
已结贴  问题点数:20 回复次数:1 
求大佬帮忙改错一下。

#include<stdio.h>                                           /*指令;头*/
int main(void);                                             /*空函数*/
{  
   int height,length, width, volume, weight;               /*参数*/
   height = 8;                                    
   length = 10;
   width = 12;
   volume = height * length * width;                        /*体积表达式*/
   weight = (volume + 165) / 166;                           /*空间质量比*/
   printf("Dimensions:%dx%dx%dx\n", lenght, width, height); /*输出值*/
   printf("Volume(cubic inches):%d\n", volume);
   printf("Dimensional weigth(pounds):%d\n", weight);
   return 0;                                               /*返回值为0*/
}
搜索更多相关主题的帖子: include printf 改错 length int 
2022-11-19 23:36
rjsp
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:507
帖 子:8890
专家分:53117
注 册:2011-1-18
得分:20 
语法错误,编译器会告诉你的,你得屈尊看一下

程序代码:
#include <stdio.h>

int main( void )
{
   int length = 10;
   int width = 12;
   int height = 8;
   int volume = height * length * width;
   int weight = (volume + 165) / 166;
   printf( "Dimensions: %dx%dx%d\n", length, width, height );
   printf( "Volume(cubic inches): %d\n", volume );
   printf( "Dimensional weigth(pounds): %d\n", weight );
}
2022-11-20 01:45



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-510705-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014789 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved