public static void Main()
for (int i = 1; i < a.Length-1; i++)
for (int i = 1; i < a.Length-1; i++)
Console.WriteLine("Enter your preferred room partner number");
a[i] = int.Parse(Console.ReadLine());
for (int t = 1; t < a.Length-1; t++)
if (a[t] == b[a[t]] && b[t] == a[b[a[t]]])
Console.WriteLine("student " + a[t] + " chose student " + a[b[a[t]]] + " and student " + b[t] + " chose student " + b[a[t]]);