[algorithm] 백준 2752번 세수정렬
·
algorithm/기초 코드
우선 필자는 배열을 선언하고 입력받은 값을 배열 인덱스에 할당해준 후 for문을 활용하여 출력하는 방식으로코드를 짰다. #include #include using namespace std;int main() { ios::sync_with_stdio(0); cin.tie(0); int a; int arr[3] = {}; for (int tmp = 0; tmp > a; arr[tmp] = a; } sort(arr, arr+3); for (int b : arr) { cout 다른 분들의 풀이를 확인해봤더니 배열을 선언하지 않고도 풀 수 있는 재미있는 방법이 있었다// Authored by ..