Day i do not know

This commit is contained in:
Electrominch
2022-10-18 00:45:31 +03:00
parent 01c5720116
commit 284b6ff10c
72 changed files with 1256 additions and 12 deletions

View File

@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>_190._Reverse_Bits</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,9 @@
namespace _190._Reverse_Bits;
internal class Program
{
static void Main(string[] args)
{
Console.WriteLine(new Solution().reverseBits(2));
}
}

View File

@@ -0,0 +1,17 @@
namespace _190._Reverse_Bits;
public class Solution
{
public uint reverseBits(uint n)
{
uint res = 0;
int count = 32;
while(count-- > 0)
{
res <<= 1;
res += n & 1;
n >>= 1;
}
return res;
}
}