프로그래머스 숫자문자열과 영단어 [c++] 2021 카카오 채용연계형 인턴십


프로그래머스 숫자문자열과 영단어 [c++] 2021 카카오 채용연계형 인턴십

#include #include #include #include #include #include #include using namespace std; int solution(string s) { int answer = 0; string temp = ""; for (int i = 0; i < s.size(); i++) { int n; if (!isdigit(s[i])) //문자열에 숫자가 아닌 문자가 존재한다면, find를 사용하여 어떤 영단어가 존재하는지 확인 { //존재한다면 영단어는 문자열에서 삭제하고 영단어의 시작위치에 해당 숫자를 추가 if (s.find("zero") != -1) { n = s.find("zero"); s.erase((s.begin() + n), (s.begin() + n + 3..


원문링크 : 프로그래머스 숫자문자열과 영단어 [c++] 2021 카카오 채용연계형 인턴십