[프로그래머스/C++]Lv.0 - 편지

YH J·2023년 4월 17일
0

프로그래머스

목록 보기
15/168

문제 링크

https://school.programmers.co.kr/learn/courses/30/lessons/120898

내 풀이

그냥 글자수 * 2

내 코드

#include <string>
#include <vector>

using namespace std;

int solution(string message) {
    int answer = 0;
    answer = message.length() * 2;
    return answer;
}

다른 사람의 풀이

#include <string>
#include <vector>

using namespace std;

int solution(string message) {
    return message.length() * 2;
}

다른 사람의 풀이 해석

그냥 바로 리턴해줌

profile
게임 개발자 지망생

0개의 댓글