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 |
Tags
- cs
- 백준
- 브루트포스
- 스택
- 알고리즘
- coding
- 그래프
- 오에스
- 문제풀이
- OS
- 정석학술정보관
- 정석
- 컴공과
- 코테
- c++
- 코딩
- Computer science
- 구현
- 자료구조
- 컴퓨터공학과
- 너비우선탐색
- Stack
- 개발
- 오퍼레이팅시스템
- DP
- 컴공
- vector
- 북리뷰
- Operating System
- bfs
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