PS/BOJ

[백준 BOJ] 11365 !밀비 급일

Jubil 2019. 8. 10. 22:49
반응형

링크

https://www.acmicpc.net/problem/11365

 

풀이

string을 받고 뒤집어 출력하면 됩니다.

algorithm 헤더에 있는 reverse() 함수를 사용해서 문제를 해결했습니다.

 

 

코드

//11365_!밀비 급일
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;

string str;

int main() {
	while (1) {
		getline(cin, str);
		if (str == "END") break;
		reverse(str.begin(), str.end());
		cout << str << endl;
	}

	return 0;
}

반응형