Notice
Recent Posts
Recent Comments
Link
«   2025/05   »
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Archives
Today
Total
관리 메뉴

행복한 개구리

(C++/Python) 백준 10171번 - 고양이 본문

Algorithm/BaekJoon

(C++/Python) 백준 10171번 - 고양이

HappyFrog 2022. 7. 8. 13:00


 

 

 

 

 

 

Python


l = ["\    /\\", " )  ( ')", "(  /  )", " \(__)|"]
arr = [1,2,3,4]

for i in range(4):
    print(l[i])

백슬래시( \ )는 "\\"라고 표기하면 string타입으로 출력할 수 있습니다.

 

 

 

C++


#include <iostream>

using namespace std;

int main() {
	cout << "\\    /\\" << "\n";
	cout << " )  ( ')" << "\n";
	cout << "(  /  )" << "\n";
	cout << " \\(__)|";
}

마찬가지로 특수문자를 출력할 땐 앞에 백슬래시를 붙여주면 됩니다.