当前位置:网站首页>3124. Word list
3124. Word list
2022-07-02 02:54:00 【Python ml】
#include <iostream>
#include <set>
using namespace std;
int main() {
int n;
cin>>n;
getchar(); //3 The following newline character
for(int i=0;i<n;i++){
string s,t; //t Save words
set<string> st;
getline(cin,s);
for(int j=0;j<s.length();j++){
if(isalpha(s[j])){
//s[j] If it is a letter, continue to add
t+=s[j];
}
if(!isalpha(s[j])||j==s.length()-1){
if(t.length()!=0) st.insert(t); //t Insert only if it is not empty
t=""; // One word input ends , empty
}
}
cout<<"case #"<<i<<":"<<endl;
for(auto it=st.begin();it!=st.end();it++){
if(it==st.begin())cout<<*it;
else cout<<" "<<*it;
}
cout<<endl;
}
return 0;
}
边栏推荐
- Analysis of FLV packaging format
- 自定义组件的 v-model
- Stack - es - official documents - filter search results
- Tupu software has passed CMMI5 certification| High authority and high-level certification in the international software field
- Connected block template and variants (4 questions in total)
- Es interview questions
- 创业了...
- Basic 01: print string
- query词权重, 搜索词权重计算
- 2022 safety officer-c certificate examination questions and mock examination
猜你喜欢
Render header usage of El table
How to create an instance of the control defined in SAP ui5 XML view at runtime?
超图iServer rest服务之feature查询
How to run oddish successfully from 0?
【带你学c带你飞】3day第2章 用C语言编写程序(练习 2.3 计算分段函数)
只需简单几步 - 开始玩耍微信小程序
Which brand of sports headset is better? Bluetooth headset suitable for sports
Force deduction daily question 540 A single element in an ordered array
Remote connection to MySQL under windows and Linux system
Connected block template and variants (4 questions in total)
随机推荐
Which brand of sports headset is better? Bluetooth headset suitable for sports
[learn C and fly] 2day Chapter 8 pointer (practice 8.1 password unlocking)
Start a business
QT实现界面跳转
Software testing learning notes - network knowledge
Rotating frame target detection mmrotate v0.3.1 learning model
Feature query of hypergraph iserver rest Service
About DNS
Es interview questions
What are the common proxy servers and what are the differences?
[pit] how to understand "parameter fishing"
2022 safety officer-c certificate examination questions and mock examination
JVM面试篇
Baohong industry | what misunderstandings should we pay attention to when diversifying investment
Build a modern data architecture on the cloud with Amazon AppFlow, Amazon lake formation and Amazon redshift
CoordinatorLayout + TabLayout + ViewPager2(里面再嵌套一个RecyclerView),RecyclerView的滑动冲突解决
使用 useDeferredValue 进行异步渲染
Principle of computer composition - interview questions for postgraduate entrance examination (review outline, key points and reference)
結婚後
2022-2028 global manual dental cleaning equipment industry research and trend analysis report