把1移动到移动0 位1 -00000000000000000000000000000001
把1移动到移动1 位2 -00000000000000000000000000000010
把1移动到移动2 位4 -00000000000000000000000000000100
把1移动到移动3 位8 -00000000000000000000000000001000
把1移动到移动4 位16 -00000000000000000000000000010000
把1移动到移动5 位32 -00000000000000000000000000100000
把1移动到移动6 位64 -00000000000000000000000001000000
把1移动到移动7 位128 -00000000000000000000000010000000
把1移动到移动8 位256 -00000000000000000000000100000000
把1移动到移动9 位512 -00000000000000000000001000000000
把1移动到移动10位1024 -00000000000000000000010000000000
把1移动到移动11位2048 -00000000000000000000100000000000
把1移动到移动12位4096 -00000000000000000001000000000000
把1移动到移动13位8192 -00000000000000000010000000000000
把1移动到移动14位16384 -00000000000000000100000000000000
把1移动到移动15位32768 -00000000000000001000000000000000
把1移动到移动16位65536 -00000000000000010000000000000000
把1移动到移动17位131072 -00000000000000100000000000000000
把1移动到移动18位262144 -00000000000001000000000000000000
把1移动到移动19位524288 -00000000000010000000000000000000
把1移动到移动20位1048576 -00000000000100000000000000000000
把1移动到移动21位2097152 -00000000001000000000000000000000
把1移动到移动22位4194304 -00000000010000000000000000000000
把1移动到移动23位8388608 -00000000100000000000000000000000
把1移动到移动24位16777216 -00000001000000000000000000000000
把1移动到移动25位33554432 -00000010000000000000000000000000
把1移动到移动26位67108864 -00000100000000000000000000000000
把1移动到移动27位134217728 -00001000000000000000000000000000
把1移动到移动28位268435456 -00010000000000000000000000000000
把1移动到移动29位536870912 -00100000000000000000000000000000
把1移动到移动30位1073741824-01000000000000000000000000000000
把1移动到移动31位2147483648-10000000000000000000000000000000
代码
using System;
namespace TestConsole
{
internal class Program
{
static void Main(string[] args)
{
uint num = 1;
for (int i = 0; i < 32; i++)
{
string d = Convert.ToString(num, 2).PadLeft(32, '0');
Console.WriteLine($"把1移动到移动{i.ToString().PadRight(2,' ')}位{num.ToString().PadRight(10,' ')}-{d}");
if (i < 31)
num = GetBit(num);
}
Console.ReadKey();
}
public static uint GetBit(uint number)
{
return number * 2;
}
}
}