标签:pre 区分大小写 限制 输入 序列 间隔 重复 输出 std
输入一行单词序列,相邻单词之间由1个或多个空格间隔,请按照字典序输出这些单词,要求重复的单词只输出一次。(区分大小写)
She wants to go to Peking University to study Chinese
Chinese Peking She University go study to wants
#include<iostream> #include<algorithm> using namespace std; string qwq[103]; int main() { int i=1; while(cin>>qwq[i]){i++;} sort(qwq+0,qwq+i+1); for(int j=1;j<=i;j++){if (qwq[j]!=qwq[j-1]) cout<<qwq[j]<<endl;} }
标签:pre 区分大小写 限制 输入 序列 间隔 重复 输出 std
原文地址:http://www.cnblogs.com/sssy/p/6596836.html