啊哈磊_编程从这里起步

标题: 为什么总是出错 [打印本页]

作者: s轩辕    时间: 2019-9-7 20:59
标题: 为什么总是出错
  1. #include <stdio.h>
  2. #define height 10
  3. int calculate(int long,int width);
  4. int main()
  5. {
  6.     int m_long;
  7.     int m_width;
  8.     int result;
  9.    
  10.     printf("长方形的高度为:%d",height);
  11.      
  12.     printf("请输入长度");
  13.     scanf("%d",&m_long);
  14.    
  15.     printf("请输入宽度");
  16.     scanf("%d",&m_long);
  17.    
  18.     result=calculate(m_long,m_width);
  19.     printf("长方体的体积是:");
  20.     printf("%d",result);
  21.     return 0;
  22. }

  23. int calculate(int long,int width);
  24. {
  25.     int result=long*width*height;
  26.     return result;
  27. }
复制代码





欢迎光临 啊哈磊_编程从这里起步 (https://bbs.codeaha.com/) Powered by Discuz! X3.2