using System;
public class Program {
static int[] arr = { 4, 7, 0, 6, 1, 8 };
static int GetNumber(int i) {
if (i < 0 || i >= arr.Length) {
throw new IndexOutOfRangeException();
}
return arr[i];
}
public static void Main() {
try {
Console.WriteLine(GetNumber(4));
Console.WriteLine(GetNumber(99));
}
catch (IndexOutOfRangeException ex) {
Console.WriteLine(ex.GetType().Name);
}
}
}
/*
run
1
IndexOutOfRangeException
*/