Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

KaspichanNumbers

By: stoianpp on Dec 25th, 2013  |  syntax: C#  |  size: 1.05 KB  |  views: 44  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. class KaspichanNumbers
  5. {
  6.     static void Main()
  7.     {
  8.         ulong inputN = ulong.Parse(Console.ReadLine());
  9.         string bigLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  10.         string smallLetters = "abcdefghijklmnopqrstuvwxyz";
  11.         List<string> numbers = new List<string>(255);
  12.         int counter = 25;
  13.         for (int i = 0; i < 26; i++) numbers.Add(bigLetters[i].ToString());
  14.         for (int i = 0; i < 26; i++)
  15.         {
  16.             for (int k = 0; k < 26; k++)
  17.             {
  18.                 if(counter == 256) break;
  19.                 numbers.Add(smallLetters[i].ToString() + bigLetters[k]);
  20.                 counter++;
  21.             }
  22.             if (counter == 256) break;
  23.         }
  24.  
  25.         List<string> output = new List<string>();
  26.         if (inputN == 0) output.Add("A");
  27.         while (inputN != 0)
  28.         {
  29.             output.Add(numbers[(int)(inputN % 256)]);
  30.             inputN /= 256;
  31.         }
  32.         output.Reverse();
  33.         Console.WriteLine(String.Join("",output));
  34.     }
  35. }