Programmers Solutions/Level-1
[프로그래머스] 문자열을 정수로 바꾸기
률무차
2021. 2. 2. 01:06
title: "문자열을 정수로 바꾸기"
category: 프로그래머스[Level-1]
tags: [C++, JavaScript, 프로그래머스]
date: "2021-01-20"
문제 링크
C++
#include <string>
#include <vector>
using namespace std;
int solution(string s) {
int answer = 0;
answer = stoi(s);
return answer;
}
JavaScript
function solution(s) {
var answer = 0;
answer = s * 1;
return answer;
}
728x90
반응형