Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
Tags
- Set
- 프로그래머스
- 문자열
- 완전탐색
- 2018
- swea
- Map
- 시뮬레이션
- dp
- BFS
- 삼성
- substr
- 삼성SW역량테스트
- 브루트포스
- 레벨2
- 레벨3
- KAKAO
- dfs
- 모의SW역량테스트
- 코딩스킬
- Sort
- C++
- 백트래킹
- find
- 코딩테스트
- priority_queue
- 백준
- STL
- 이런게4문제
- 삼성SW테스트
Archives
- Today
- Total
목록정수 (1)
-
[코딩스킬] string<->int 변환
string을 int로 변환, int를 string으로 변환해야 할 때가 종종있다. 이 때 어떻게 해야하는지 여기에 기록해둔다. (공통 라이브러리) #include #include #include 1. string -> int 변환 string str1 = "12345"; int str2int; stringstream s_str(str1); s_str >> str2int; 2. int -> string 변환 int in1 = 12345; ostringstream ostr; ostr 숫자로 바꿀때는 '0'을 빼면되고, 반대의 경우 더하면 변환된다. (문자)7 -> (숫자)7은 '7'-'0'으로.
7. 코딩 스킬
2020. 1. 1. 22:49