일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
Tags
- 2020.03.16
- ppt
- 알고리즘
- C
- 학습용
- rendering pipeline
- Conjugate Gradient
- 백준
- numerical method
- Til
- stretch force
- oprerator
- 참조자
- ComputeShader
- sparse matrix
- 2020.02.23
- Overloading
- 논문
- 알고리즘연습
- game jam
- C++
- 프로그래머스
- Implicit method
- UNORDERED_MAP
- 독서
- graphics
- algorithm #알고리즘 #백준
- class
- TIP
- Algorithm
Archives
- Today
- Total
OSgood의 개발일기
[CodeUp]2016 천단위 구분기호 본문
2016 천단위 구분기호
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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | #include <iostream> #include <stack> #include <vector> using namespace std; int main() { int a; char cs[1000]; stack<char> st; vector<char> result; cin >> a; cin >> cs; int i = 0; while (cs[i] != '\0') { st.push(cs[i]); i++; } char tmp; int cnt = 0; while (!st.empty()) { cnt++; if (cnt % 4 == 0) { result.push_back(','); } else { tmp = st.top(); result.push_back(tmp); st.pop(); } } vector<char>::reverse_iterator itr = result.rbegin(); for (itr;itr !=result.rend(); itr++) { cout << *itr; } return 0; } | cs |
'Algorithm > Algorithm 문제 연습' 카테고리의 다른 글
[백준] 1715번 카드 정렬하기 (0) | 2020.03.08 |
---|---|
[백준] 2583번 영역 구하기 (0) | 2020.02.23 |
[백준] 14867번 물통문제 (0) | 2020.02.15 |
[프로그래머스] LEVEL2 기능개발(C++) (0) | 2019.01.13 |
[프로그래머스] LEVEL2 탑문제(C++) (0) | 2019.01.11 |
Comments