Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- class Program
- {
- public static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- bool hasMaxEvenNumFound = false;
- List<int> intList = new List<int>();
- for (int i = 1; i <= n; i++)
- {
- int tmp = i;
- int cnt = 0;
- int cnt2 = 0;
- bool isEven = true;
- while (isEven)
- {
- if (i % 2 == 0 && tmp != 0)
- {
- tmp /= 2;
- cnt++;
- }
- else
- {
- isEven = false;
- intList.Add(cnt);
- }
- }
- }
- Console.WriteLine(intList.IndexOf(intList.Max())+1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement