algorithm/dimigo.goorm.io
연산자 - 연산자의 활용 예제7
m0nd2y
2018. 7. 5. 20:23
Practice Contents
4자리 16진수를 입력받아 홀수비트에 해당하는 값을 1로 바꾸어 16진수로 출력하는 프로그램을 구현하시오.
⋇ Please keep the input/output format well.
#include <stdio.h>
int main() {
int a;
scanf("%x", &a);
a = a | 0x5555;
printf("0x%x", a);
return 0;
}