프로그래머스 12903 가운데 글자 가져오기

1 개요[ | ]

프로그래머스 12903 가운데 글자 가져오기

2 C++[ | ]

#include <string>
#include <vector>

using namespace std;

string solution(string s) {
    if(s.length()%2==0) {
        return s.substr(s.length()/2-1, 2);
    }
    return s.substr(s.length()/2, 1);
}
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}