프로그래머스 12918 문자열 다루기 기본

Jmnote (토론 | 기여)님의 2024년 1월 4일 (목) 23:52 판 (→‎C++)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

1 개요[ | ]

프로그래머스 12918 문자열 다루기 기본

2 C++[ | ]

#include <string>
#include <vector>

using namespace std;

bool solution(string s) {
    if(s.length() != 4 && s.length() !=6) return false;
    for(const auto& c: s) {
        if(!isdigit(c)) return false;
    }
    return true;
}
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}