CS
cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
using System;
using static System.Console;
using System.Linq;
// Por Marfik Em
// 10/12/2017 (DD/MM/AAAA)
namespace Challenge
{
class Program
{
static void Main(string[] args)
{
uint limit = 10000;
WriteLine("Count of odious numbers smaller than '{0}' is equal to '{1}'.", limit, Enumerable.Range(0, (int)limit).Count(n => Convert.ToString(n, 2).Count(b => b == '1') % 2 == 1));
}
}
}
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run