-
[백준 문제풀이 C언어] 10926번 ??!백준 문제풀이 2023. 9. 27. 23:00반응형
여기서는 문자열 변수를 써야 한다.
char 변수이름; 의 형식이고 문자 제한이 50으로 되어있으므로 char 변수이름 [51]; 으로 지정하면 된다.
왜 51인가 하면 문자의 끝에는 NULL이라는 것이 있는데 이것은 공백이며 NULL을 위해 여분으로 한자리를 남기는 것이 좋다.
출력할 때는 %s 를 쓰면 된다.
여기서 삼중자(Trigrah)에 대해서도 알아야 한다.
삼중자는 자주 쓰지 않는 문자 조합으로 다른 문자를 표현한 것이다.
삼중자 출력 ??= # ??( [ ??/ \ ??) ] ??' ^ ??< { ??! | ??> } ??- ~ 우리가 출력하고 하는 ??!를 그대로 쓰게 되면 |로 바뀌어서 출력된다는 뜻이다.
이러한 삼중자 떄문에 ??!에 역슬래시를 넣게 되면 정상으로 출력된다.
?\?!
(하지만 백준에서는 삼중자를 따지지 않게 바뀌었다.)
728x90반응형'백준 문제풀이' 카테고리의 다른 글
[백준 문제풀이 C언어] 10430번 나머지 (0) 2023.09.28 [백준 문제풀이 C언어] 18108번 1988년생인 내가 태국에서는 2541년생? (0) 2023.09.27 [백준 문제풀이 C언어] 10869번 사칙연산 (0) 2023.09.25 [백준 문제풀이 C언어] 1008번 A/B (0) 2023.09.24 [백준 문제풀이 C언어] 10998번 A×B (0) 2023.09.23