using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Array_6
{
internal class Program
{
static void Main(string[] args)
{
int[] a = new int[5];
int index = 0;
for (int i = 0; i <= 4; i++)
{
Console.Write("a[" + i + "] = " );
a[i] = Convert.ToInt32(Console.ReadLine());
}
int max = a[0];
for(int j=1; j<= 4; j++)
{
if (a[j] > max)
{
max = a[j] ;
index = j ;
}
}
Console.Write(" max = {0} ", max);
Console.Write("Index = {0}", index);
Console.WriteLine();
}
}
}
- ۹۴/۰۶/۱۷