Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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
- 컴퓨터공학과
- 브루트포스
- 개발
- 코딩
- 컴공과
- c++
- 코테
- 알고리즘
- 백준
- 자료구조
- DP
- 정석
- Computer science
- 정석학술정보관
- vector
- 오퍼레이팅시스템
- 그래프
- 오에스
- coding
- 컴공
- cs
- 문제풀이
- Stack
- 구현
- 북리뷰
- 스택
- bfs
- Operating System
- 너비우선탐색
- OS
Archives
- Today
- Total
Little Jay
[C++] 백준 1427번 소트인사이드 본문
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int arr[10];
int n;
int cnt = 0;
cin >> n;
while (n != 0) {
arr[cnt] = n % 10;
n /= 10;
cnt++;
}
sort(arr, arr + cnt, greater<int>());
for (int i = 0; i < cnt; i++) {
cout << arr[i];
}
return 0;
}'알고리즘 > BOJ' 카테고리의 다른 글
| [C++] 백준 16395번 파스칼의 삼각형 (0) | 2021.05.10 |
|---|---|
| [C++] 백준 1436번 영화감독 숌(에러) (0) | 2021.05.04 |
| [C++] 백준 1316번 요세푸스 문제 (0) | 2021.05.04 |
| [C++] 백준 2231번 분해합 (0) | 2021.05.03 |
| [C++] 백준 2108번 통계학 (0) | 2021.05.03 |
Comments