當前位置:編程學習大全網 - 編程軟體 - 我是c語言初學者,我寫的程序總顯示缺少函數標題 ,請問為什麽,並請幫忙解決,謝謝

我是c語言初學者,我寫的程序總顯示缺少函數標題 ,請問為什麽,並請幫忙解決,謝謝

看妳那麽晚還在學習,幫妳改壹下:

#include<stdio.h>

int calculate(int lng, int width, int hight);//函數參數不能用C語言的關鍵字long

int main()

{

int m_long;

int m_width;

int m_hight;

int result;

printf("請輸入長度\n");

scanf("%d",&m_long);

printf("請輸入寬度\n");

scanf("%d",&m_width);

printf("請輸入高度\n");

scanf("%d",&m_hight);

result=calculate(m_long,m_width,m_hight);

printf("長方體的體積是 ");

printf("%d\n",result);

getchar();

getchar();

return 0;

}

int calculate(int lng, int width, int hight)//這裏的分號要去掉

{

int result=lng*width*hight;

return result;

}

  • 上一篇:vb系統中的用戶登錄系統如何制作,求編程源代碼和設計界面
  • 下一篇:菜鳥請教壹道簡單匯編題
  • copyright 2024編程學習大全網