Guest User

Untitled

a guest
Feb 21st, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace ConsoleApplication1
  7. {
  8. class Program
  9. {
  10. static void Main(string[] args)
  11. {
  12. int n=int.Parse(Console.ReadLine());
  13. if (n % 2 == 1)
  14. Console.Write(0);
  15. else
  16. {
  17. List<int> l = new List<int>();
  18.  
  19. while (n != 0)
  20. {
  21. n = n / 2;
  22. l.Add(n % 2);
  23. }
  24. for (int i = 0; i < l.Count; i++)
  25. if (l[i] == 1)
  26. {
  27. Console.Write(i + 1);
  28. break;
  29. }
  30. }
  31.  
  32. }
  33. }
  34. }
Add Comment
Please, Sign In to add comment