#include <bits/stdc++.h>
using namespace std;
void main()
{
int i = 5, j = 0;
while (i)
{
j = i & 1;
i >>= 1;
cout << j << endl;
}
}
C++求2进制最后一位
最新推荐文章于 2023-02-12 14:58:25 发布
#include <bits/stdc++.h>
using namespace std;
void main()
{
int i = 5, j = 0;
while (i)
{
j = i & 1;
i >>= 1;
cout << j << endl;
}
}