archangelmihail

ExcelComuns

Dec 4th, 2013
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.58 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ExcelComuns
  8. {
  9.     class ExcelComuns
  10.     {
  11.         static void Main()
  12.         {
  13.             int n = int.Parse(Console.ReadLine());
  14.             char[] input = new char [n];
  15.             long current= 0;
  16.             for (int i = 0; i < n; i++)
  17.             {
  18.                 input[i] = Convert.ToChar(Console.ReadLine());
  19.                 current = current + (input[i] - 64) * (long)Math.Pow(26, n - i - 1);
  20.             }
  21.             Console.WriteLine(current);
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment