update: userprog (tee, tsh, sleep, hex2bin)
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
#include <stdio.h>
|
||||
|
||||
// 사용법: echo "41 42 43" | hex2bin
|
||||
int main() {
|
||||
int byte;
|
||||
// 16진수(%x)로 정수를 읽어서
|
||||
while (scanf("%x", &byte) == 1) {
|
||||
// char(바이트) 형태로 stdout에 씀
|
||||
unsigned char c = (unsigned char)byte;
|
||||
fwrite(&c, 1, 1, stdout);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user