右移:先变成2进制,再整体往右移,such as:8->0100,右移后->0010;
int n; int main() { scanf_s("%d", &n); printf("%d", n >> 1); return 0; } 左移同理,不过需要注意只适于正数。