using System;
using System.Collections.Generic;
namespace ConsoleApplication_C_Sharp
{
class Program
{
static void Main(string[] args)
{
List<int> list = new List<int>(new int[] { 18, 21, 31, 12, 7 });
int index = list.IndexOf(31);
Console.WriteLine(index);
index = list.IndexOf(16);
Console.WriteLine(index);
}
}
}
/*
run:
2
-1
*/