/*目的:练习找出数组中最大的一个数
*知识点:函数
*作者:beeone
*日期:2011-02-19
*/

using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int[] ArryText = { 12,1, 5, 2, 9, 15, 98, 44, 100, 33, 654,0 ,-1};
Console.WriteLine(
"最大的数是:"+GetMaxNum(ArryText));
Console.ReadKey();

}
static int GetMaxNum(int[] Myarry)
{
int NUM = Myarry[0];
for (int i = 0; i < Myarry.Length; i++)
{
if (Myarry[i] >NUM)
{
NUM
= Myarry[i];
}
}
return NUM;
}


}
}

相关文章:

  • 2021-06-30
  • 2021-10-07
  • 2022-12-23
  • 2021-07-27
  • 2022-01-30
猜你喜欢
  • 2021-07-26
  • 2021-09-15
  • 2022-01-18
  • 2022-12-23
  • 2021-06-14
  • 2021-12-18
相关资源
相似解决方案