#include <stdio.h>
int main() {
int x;
while(scanf("%d", &x) != EOF) {
printf("%d\n", x & (x + 1));
}
return 0;
}
与运算(&):
相同才得1,不同则为0;
#include <stdio.h>
int main() {
int x;
while(scanf("%d", &x) != EOF) {
printf("%d\n", x & (x + 1));
}
return 0;
}
与运算(&):
相同才得1,不同则为0;