/* © MATTO MATTI 2018 http://mattomatti.com/pl/a0153 napisane przy użyciu Visual Studio Community 2015 2018-09-23 v 1.0 */ using System; namespace plcode1cs { class Program { static int policzBity(int a) { int bitow = 0; while (a > 0) { bitow += a % 2; a /= 2; } return bitow; } static void Main(string[] args) { Console.Write("Podaj liczbę\n a = "); int a = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("f({0}) = {1}", a, policzBity(a)); Console.ReadKey(); } } }