Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace ConsoleApplication1
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n=int.Parse(Console.ReadLine());
- if (n % 2 == 1)
- Console.Write(0);
- else
- {
- List<int> l = new List<int>();
- while (n != 0)
- {
- n = n / 2;
- l.Add(n % 2);
- }
- for (int i = 0; i < l.Count; i++)
- if (l[i] == 1)
- {
- Console.Write(i + 1);
- break;
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment