daily pastebin goal
13%
SHARE
TWEET

Untitled

a guest Feb 21st, 2018 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top