링크 : https://www.acmicpc.net/problem/1755
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
bool comp(pair<string, int> a, pair<string, int>b){
return a.first < b.first;
}
int main(){
string arr[10] = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"};
int M, N;
cin >> M >> N;
vector<pair<string, int>> v;
for(int i = M; i <= N; i++){
string now = "";
if(i < 10){
now = arr[i];
v.push_back({now, i});
}
else{
now = arr[i/10] + arr[i%10];
v.push_back({now, i});
}
}
sort(v.begin(), v.end(), comp);
int i = 1;
for(auto it = v.begin(); it != v.end(); it++){
cout << it->second << " ";
if(i % 10 == 0) cout << '\n';
i++;
}
return 0;
}