반응형
https://www.acmicpc.net/problem/23235
23235번: The Fastest Sorting Algorithm In The World
It is common to compare sorting algorithms based on their asymptotic speeds. Some slower algorithms like selection sort take O(N2) time to sort N items, while comparison-based sorts like merge sort can go no faster than O(N log(N)) time, under reasonable a
www.acmicpc.net
간단한 출력문제였습니다.
📕 풀이방법
📔 입력 및 초기화
문자열 s를 선언 후 getline함수를 이용해 한 줄씩 "0"일 때까지 입력받습니다.
📔 정답출력
매 test case마다 형식에 맞게 출력합니다.
📕 Code
#include <bits/stdc++.h>
using namespace std;
string s;
int main(){
for(int i = 1;;i++){
getline(cin, s);
if(s == "0") break;
printf("Case %d: Sorting... done!\n", i);
}
}
*더 나은 내용을 위한 지적, 조언은 언제나 환영합니다.
'Algorithm > Implementation' 카테고리의 다른 글
(C++) - 백준(BOJ) 20944 : 팰린드롬 척화비 (0) | 2022.06.21 |
---|---|
(C++) - 백준(BOJ) 21866 : 추첨을 통해 커피를 받자 (0) | 2022.06.18 |
(C++) - 백준(BOJ) 8719 : Piłeczka (0) | 2022.06.14 |
(C++) - 백준(BOJ) 11648 : 지속 (0) | 2022.06.13 |
(C++) - 백준(BOJ) 4589 : Gnome Sequencing (0) | 2022.06.12 |