![]() |
#2
wp2319572014-02-22 14:40
|
public static int Paixu( int shuzu)
{
for (int a=0;a<shuzu.Length ;a++ )
{
int zuida;
zuida = shuzu[0];
if (zuida < shuzu[a])
{
zuida = shuzu[a];
}
}
return zuida;
}
static void Main(string[] args)
{
int[] shuzu = new int[5];
for (int a=0;a<shuzu.Length ;a++ )
{
Console.WriteLine("请输入数值");
shuzu[a] = Convert.ToInt32(Console.ReadLine());
}
int _zuida =zuida;
Console.WriteLine("最大数值为{0}",_zuida);