gpt4 book ai didi

计算立方体的体积

转载 作者:行者123 更新时间:2023-11-30 21:46:05 25 4
gpt4 key购买 nike

 printf("The Volume of the cuboid with a height of%d", height);
printf("and width of%d\n", width);
printf("and depth of%d\n", depth);
printf("Gives you the Volume of %lf\n", vcuboid);

“volumeofcuboid.c:5:错误:此处未声明“height”(不在函数中)volumeofcuboid.c:5:错误:此处未声明“width”(不在函数中)volumeofcuboid.c:5:错误:此处未声明“深度”(不在函数中)“

最佳答案

对于初学者:

  1. #!/bin/bash

C 不是 shell 脚本。即使您使用的是 cshell,也不会。

  1. vcuboid(高度、宽度、深度);

不是有效的函数原型(prototype),并且您从未提供实际的函数。

  1. main()

不是 main() 的有效定义,应该是 int main(void)

  1. vcuboid=((高*宽*深));

vcuboid 尚未定义。

只是,不。

  1. 退出(0);

返回0;

关于计算立方体的体积,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18112480/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com