//Check input whether legal and calculate function GetMagic(n) { switch(n) { case 3: return "There are 8 magic squares which has order of 3. Elapsed time < 10^-5 seconds"; case 4: return "There are 7040 magic squares which has order of 4. Elapsed time = 720 seconds"; case 5: return "The program can not reach the results in 10 minutes." } }