當前位置:編程學習大全網 - 電腦編程 - 編程實現輸入班裏10名學生的身高,獲得身高最高的學生。要求使用對象數組類型的帶參方法實現!

編程實現輸入班裏10名學生的身高,獲得身高最高的學生。要求使用對象數組類型的帶參方法實現!

public Students getMaxheight(Students[] stu){

if(stu == null) return null;

if(stu.length == 0) return null;

var maxStudent = str[0]

foreach(var x in stu)

{

maxStudent = maxStudent .Height > x.Height ? maxStudent :x;

}

return maxStudent ;

}

  • 上一篇:ansys在使用UPFs二次開發連接時壹直連接不上,顯示必須定義入口是什麽原因
  • 下一篇:數據庫或者編程,壹般用什麽系統?
  • copyright 2024編程學習大全網