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
관리 메뉴

행복한 개구리

(Python/C#/C++) 백준 25083번 - 새싹 본문

Algorithm/BaekJoon

(Python/C#/C++) 백준 25083번 - 새싹

HappyFrog 2022. 7. 13. 15:15


 

 

 

특수문자를 출력하고 싶을 땐 앞에 백슬래시 ( \ )를 달아주면 된다는 사실을 알면 됩니다.

 

 

 

Python


arr = ["         ,r\'\"7", "r`-_   ,\'  ,/", " \\. \". L_r\'", "   `~\\/", "      |","      |"]

for i in arr:
    print(i)

 

 

 

C#


string[] arr;

arr = new string[] { "         ,r\'\"7", "r`-_   ,\'  ,/", " \\. \". L_r\'", "   `~\\/", "      |", "      |" };

foreach (string i in arr)
{
    Console.WriteLine(i);
}

 

 

 

C++


#include <iostream>

using namespace std;

int main() {
	string arr[] = {
		"         ,r\'\"7\n", 
		"r`-_   ,\'  ,/\n", 
		" \\. \". L_r\'\n", 
		"   `~\\/\n", 
		"      |\n",
		"      |\n" 
	};
	cout << arr[0];
	cout << arr[1];
	cout << arr[2];
	cout << arr[3];
	cout << arr[4];
	cout << arr[5];
}

왠지 모르겠지만 출력을 반복문을 통하여 실행하면 출력초과가 뜹니다. 그래서 cout코드를 6번 사용하여 출력했습니다.