c語言改錯題,C語言改錯題

2021-12-19 07:48:14 字數 1220 閱讀 7728

1樓:

#include

void main()

sum -= n; // sum先減n

n--;  //n再自減

}#include

void main()

int fun(int a)//這裡要宣告引數型別return i;//返回i值}

2樓:woailuo帥

int sum=0,因為後面直接呼叫了,所有要賦值。

while (sum<1000)//這裡要有括號n--;後面的sum=sum-n;

2.fun()函式

應該是fun(int a)

return應該是是return i;吧

3樓:匿名使用者

while裡面可以考慮 巢狀for迴圈做

4樓:匿名使用者

錯誤一:static int a[m]=} 的賦值格式錯誤,應該是a[n]其中n為已知。否則就要採起動態輸入了。這可以改為a[n].

錯誤二:max=a[0,0]類似一的錯誤,二維陣列格式為a.

錯誤三:在二重迴圈當中用到的m,n兩個小寫字母的變數為不明變數。你前面define的只是大寫的,下面小寫的當然認不到。

錯誤四:主函式沒有反回值。即是在最後沒有return ().

錯誤五:二重迴圈中第一重迴圈

return 0;}

c語言改錯題,請在原程式中改錯····

5樓:寒寒家

//修改好啦,測試執行通過

#include

main( )

;int i,t;

/**********error***************/for(i=0;i<5;i++)

for(i=0;i<10;i++)

} //少個大括號

6樓:聽不清啊

#include

main( )

;int i,t;

/**********error***************/for(i=0;i<5;i++)

for(i=0;i<10;i++)}

C 程式改錯題,c 程式改錯題

chang c 1,5 d 6,3 c.display d.display 這裡錯了。chang只是rectangle類的一個函式,不是一個類,你這樣使用是不對的。你可以這麼使用rectangle rec rec.chang 1,5 rec.display 另外rectangle rectangle...

初二英語改錯題,英語改錯題,

1.the去掉 2.he改him 3.softly改soft 4.do去掉 5.to改for 6.answer改answered 7.long改soon 8.in改on 9.easy改easier 10.after改behind 11。seventy years old改seventy year o...

高三英語改錯題,高三英語改錯題

除了你改對的七個錯之外,還有三個錯,在第一行 while 改為when 第二行 closing 改為 closed 第三行 it 改為there 高中英語改錯題 一 所給短文改錯答案 1.eye 1.eye eyes 2.whatever whenever3.lend lent 4.as when ...