| Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 79072 | sh25_ganzy | 单词排序 | C++ | 通过 | 1 MS | 252 KB | 458 | 2025-12-28 17:59:21 |
#include<iostream> #include<algorithm> #include<string> using namespace std; int main(){ string word[110],s; int cnt=1; while(cin>>s){ word[cnt]=s; cnt++; } cnt=cnt-1; for(int t=1;t<cnt;t++){ for(int wei=1;wei<cnt-(t-1);wei++){ if(word[wei]>word[wei+1]){ swap(word[wei],word[wei+1]); } } } for(int i=1;i<=cnt;i++){ if(word[i]==word[i+1]){ continue; } cout<<word[i]<<endl; } return 0; }