https://www.acmicpc.net/problem/1181
이게 문제 링크고
코드는
#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
int main(void) {
int t;
int n = 0;
int c = 0;
cin >> t;
string temp;
string str[t] = {};
for(int i = 0; i < t; i++) {
cin >> str[i];
}
stable_sort(str, str + t);
for(int i = 0; i < t; i++) {
for(int j = i+1; j < t; j++) {
if(str[i].size() > str[j].size()) {
temp = str[i];
str[i] = str[j];
str[j] = temp;
}
}
}
for(int i = 0; i < t; i++) {
if(str[i] != str[i + 1]) {
c++;
}
}
string num[t] = {};
for(int i = 0; i < t; i++) {
if(str[i] != str[i + 1]) {
num[n] = str[i];
n++;
}
}
for(int i = 0; i < c; i++) {
cout << num[i] << endl;
}
return 0;
}
이건데 진짜 다 해도 안돼 제바ㅣㄹ ㄱ살려줘
틀렸네요
어디가 틀렸는지 제발요 ㅠㅠ