본문 바로가기

Algorithm/Implementation

(C++) - 백준(BOJ) 23235 : The Fastest Sorting Algorithm In The World

반응형

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);
  }
}

*더 나은 내용을 위한 지적, 조언은 언제나 환영합니다.