목록PS (3)
넘치게 채우기
#include // 모든 라이브러리 불러오기 형변환 static_cast(값); #정적 자료형 변환. C++에서 기본으로 제공하는 자료형 안에서 형변환을 해준다. dynamic_cast(값); #동적 자료형 변환. 자식 클래스의 포인터/참조에서 부모 클래스의 포인터/참조로 형변환을 해준다. reinterpret_cast(값); #포인터 형태를 바꿔주는데, 어떤 자료형이든 가능하다. 자료형을 막 변환시킬 수 있다. const_cast(값); #const 성향을 없앨 수 있다. PS에서는 static_cast만 기억하면 된다! stoi(string) #문자열을 int로 변환시켜준다. stoi = string to int stof = string to float stol = string to long sto..
https://leetcode.com/problems/reverse-integer/description/ Reverse Integer - LeetCode Can you solve this real interview question? Reverse Integer - Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 32-bit integer range [-231, 231 - 1], then return 0. Assume the envir leetcode.com 문제 유형 : 수학 난이도 : Medium 문제 Given a signed ..
https://leetcode.com/problems/roman-to-integer/ Roman to Integer - LeetCode Can you solve this real interview question? Roman to Integer - Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I 1 V 5 X 10 L 50 C 100 D 500 M 1000 For example, 2 is written as II in Roman numeral, just tw leetcode.com 난이도 : Easy 문제 Roman numerals are represented by seven d..