문제) 백준 - 문자열 - !밀비 급일
https://www.acmicpc.net/problem/11365
11365번: !밀비 급일
당신은 길을 가다가 이상한 쪽지를 발견했다. 그 쪽지에는 암호가 적혀 있었는데, 똑똑한 당신은 암호가 뒤집으면 해독된다는 것을 발견했다. 이 암호를 해독하는 프로그램을 작성하시오.
www.acmicpc.net
문자열을 차례대로 입력 받아 역순으로 출력합니다.
C++ 소스 코드)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<bits/stdc++.h> | |
#define endl "\n" | |
#define MAX 200001 | |
#define int long long | |
using namespace std; | |
typedef pair<int, int> p; | |
signed main() { | |
ios_base::sync_with_stdio(0); | |
cin.tie(0); cout.tie(0); | |
string s; | |
while (1) { | |
getline(cin, s); | |
if (s == "END") break; | |
for (int i = 0; i < s.size(); ++i) | |
cout << s[s.size() - i - 1]; | |
cout << endl; | |
} | |
return 0; | |
} |
반응형
'PS(Problem Solving) > 백준_BOJ' 카테고리의 다른 글
[백준] 18113번 - 그르다 김가놈 (C++) 문제 및 풀이 (0) | 2022.02.04 |
---|---|
[백준] 18513번 - 샘터 (C++) 문제 및 풀이 (0) | 2022.02.03 |
[백준] 7511번 - 소셜 네트워킹 어플리케이션 (C++) 문제 및 풀이 (0) | 2022.01.30 |
[백준] 16507번 - 어두운 건 무서워 (C++) 문제 및 풀이 (0) | 2022.01.29 |
[백준] 14467 - 소가 길을 건너간 이유 1 (C++) 문제 및 풀이 (0) | 2022.01.29 |
댓글