Advertisement
mivak

Sheets

Dec 4th, 2013
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 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 Sheets
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int number = int.Parse(Console.ReadLine());
  14.  
  15. int[] array = new int[11];
  16.  
  17. for (int i = 0; i < array.Length; i++)
  18. {
  19. array[i] = (int)Math.Pow(2, array.Length -1 - i);
  20. if (number < array[i])
  21. {
  22. Console.WriteLine("A{0}", i);
  23. }
  24. else
  25. {
  26. number -=array[i];
  27. }
  28. }
  29. }
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement