"프로그래머스 181912 배열 만들기 5"의 두 판 사이의 차이

(새 문서: ==개요== {{프로그래머스|레벨=0|페이지=3}} ==C++== <syntaxhighlight lang='cpp'> #include <string> #include <vector> using namespace std; vector<int> solution(vector<str...)
 
 
1번째 줄: 1번째 줄:
==개요==
==개요==
{{프로그래머스|레벨=0|페이지=3}}
{{프로그래머스|레벨=0|페이지=3|분류=코딩 기초 트레이닝}}


==C++==
==C++==

2023년 11월 14일 (화) 22:43 기준 최신판

1 개요[ | ]

프로그래머스 181912 배열 만들기 5

2 C++[ | ]

#include <string>
#include <vector>

using namespace std;

vector<int> solution(vector<string> intStrs, int k, int s, int l) {
    vector<int> answer;
    int n;
    for(auto& str: intStrs) {
        n = atoi(str.substr(s,l).c_str());
        if(n>k) answer.push_back(n);
    }
    return answer;
}
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}