문제 링크
난이도 : Lv. 0
문제 내용
아래 출력대로 출력하기
출력
!@#$%^&*(\\'"<>?:;
문제 분석
이스케이프 문자 잘 써서 하면 될듯
작성한 코드
#include <iostream>
using namespace std;
int main(void) {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout << "!@#$%^&*(\\\\'\\"<>?:;";
return 0;
}
우수 코드 분석
#include <iostream>
using namespace std;
int main(void) {
cout << R"(!@#$%^&*(\\'"<>?:;)";
}
R이 뭔지 봤더니 C++11부터 도입된 Raw String Literal이라고 함
참고 자료 : https://dad-rock.tistory.com/m/45
R”구분자(내용)구분자“ 로 구성됨
괄호 안에 있으면 무조건 string으로 취급되어서 굳이 이스케이프 문자 안넣어도 됨