using System.Collections.Generic;
using System.Text.RegularExpressions;
public static void Solution(int number)
var stk = new Stack<int>();
for(int i=0;i<sizeof(int)*8;i++)
stk.Push((number&(1<<i))==0?0:1);
Console.Write(stk.Pop());
public static void Main()
string text = @"Historically, the world of data and the world of objects" +
@" have not been well integrated. Programmers work in C# or Visual Basic" +
@" and also in SQL or XQuery. On the one side are concepts such as classes," +
@" objects, fields, inheritance, and .NET Framework APIs. On the other side" +
@" are tables, columns, rows, nodes, and separate languages for dealing with" +
@" them. Data types often require translation between the two worlds; there are" +
@" different standard functions. Because the object world has no notion of query, a" +
@" query can only be represented as a string without compile-time type checking or" +
@" IntelliSense support in the IDE. Transferring data from SQL tables or XML trees to" +
@" objects in memory is often tedious and error-prone.";
text = string.Join(" ", Enumerable.Range(0,300).Select(a=>text));
var dict = text.Split(' ').GroupBy(a=>a).Select(a=>new{ Word = a.Key, Count = a.Count()}).ToArray();