正數和負數二維數組的總和平均值如何找到在C與正數和負數二維數組的總和平均我如何才能找到在C
int data[4][5] = {
{3,-6,1,-5,7},
{-2,9,-3,5,4},
{7,3,-4,0,-6},
{9,-2,-5,8,3}
};
>Sum of all positive number
>Mean of all positve number
>Sum of all negative number
>Mean of all negative number
我從念大一我明天有期末考試,請幫助我練習。謝謝!
掃描整個數組if(a [i] [j]> 0),找到它們的總和並跟蹤總正數。除以總額。對於負數也是如此。 – lU5er
你可以給我解釋我的代碼,請先生。 – Tony
@RoadRunner謝謝你,我會爲它做更多的事情,但LP有什麼問題我在這篇文章中做了什麼錯誤,如果錯了,我會刪除它 – Tony