using System.Text;
namespace ConsoleApplication3
{
class Program
{
static void Main(string[] args)
{
int min;
int index = 0;
int[] points = { 18, 25, 7, 36, 13, 2, 89, 63 };
for (int i = 0; i <= 7; i++)
{
min = points[0];
if (points[i] < min)
{
min = points[1];
index = i;
}
}
Console.WriteLine("最小值为{0},所在的位置{1}",points [ index ],index+1);
Console.ReadKey();
网友评论