프로그래머스 - 문자열을 정수로 바꾸기

well-life-gm·2021년 11월 6일
0

프로그래머스

목록 보기
41/125

프로그래머스 - 문자열을 정수로 바꾸기

문자열을 정수로 바꿀 때 stoi를 쓰면, 부호까지 적용해준다 ㅎㅎ

#include <string>
#include <vector>

using namespace std;

int solution(string s) {
    return stoi(s);
}
profile
내가 보려고 만든 블로그

0개의 댓글