using System.Collections.Generic;
private static readonly List<Tuple<int, int>> list = new List<Tuple<int, int>>()
private static int Exponentiation( int n, int p )
else if (n == 0 && p == 0)
throw new Exception("n and p should not be zero.");
throw new Exception("n or p should not be negative.");
public static void Main()
foreach(Tuple<int, int> pair in list)
Console.Out.WriteLine(Program.Exponentiation(pair.Item1, pair.Item2));
Console.Out.WriteLine(e.Message);