3

求教各位前辈关于多维数组求平均值。

 1 year ago
source link: https://www.v2ex.com/t/884882
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

V2EX  ›  C#

求教各位前辈关于多维数组求平均值。

  jayvs5200 · 2 小时 53 分钟前 · 136 次点击

小弟编程新手,想跟各位前辈请教关于多维数组求平均值的问题。

####我的思路

  • 使用 for 取的数组内的数值
  • 将取得的数值相加为 sum
  • 使用 sum 除以数组内的位数得出平均值

####问题 求得的平均值不正确

错误示范如下; Imgur

希望能得到各位前辈指导,已经尝试在 google 寻找答案,但是没找到解(关键词用错了吗?); 麻烦各位前辈!


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK