https://school.programmers.co.kr/learn/courses/30/lessons/181848
프로그래머스
SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프
programmers.co.kr
자바
======================
class Solution {
public int solution(String n_str) {
int result = Integer.parseInt(n_str);
return result;
}
}
======================
자바스크립트
======================
function solution(n_str)
{
var answer = 0;
answer = parseInt(n_str);
return answer;
}
======================
파이썬
======================
def solution(n_str):
result = int(n_str)
return result
======================
파이썬에서 문자열을 정수로 바꾸는 내장 함수는 int()입니다.
https://docs.python.org/ko/3.8/library/functions.html?highlight=int#int
내장 함수 — Python 3.8.20 문서
내장 함수 파이썬 인터프리터에는 항상 사용할 수 있는 많은 함수와 형이 내장되어 있습니다. 여기에서 알파벳 순으로 나열합니다. abs(x) 숫자의 절댓값을 돌려줍니다. 인자는 정수 또는 실수입
docs.python.org
C언어
======================
======================
C++
======================
======================
'Portpolio > codingtest' 카테고리의 다른 글
프로그래머스 각도 합치기 풀이 (0) | 2025.02.26 |
---|---|
프로그래머스 문자 출력 풀이 (0) | 2025.02.26 |
python 내장 함수 (0) | 2025.02.23 |
프로그래머스 가습기 풀이 (0) | 2025.02.19 |
프로그래머스 문자열안에 문자열 풀이 (0) | 2025.02.16 |
댓글