백준

11365 !밀비급일

불타는강정 2019. 10. 25. 18:44

 

#include <iostream>
#include <algorithm>
using namespace std;

int main() {
    string str, remainder;
    
    while(true){
        getline(cin, str);
        if(str.compare("END") == 0)
            break;
        reverse(str.begin(), str.end());
        cout << str << endl;
    }
    
    return 0;
}

 

오 씨쁠쁠도 문자열 비교 가능하다 

str == "END"

이렇게 쓸 수 있음

 

#include <iostream>
#include <algorithm>
using namespace std;

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