第一题代码如下: #include <bits/stdc++.h> using namespace std; set<string>st; string s; int main() { cin>>s; int t=0; for(int i=0;i<s.size()-1;i++){ if(s[i]=='d'&&s[i+1]=='p'){ string str=s.substr(t,i-t); t=i+2; if(str.find('d')==-1&&str.find('p')==-1){ st.insert(str); } } } cout<<st.size(); return 0; }
点赞 评论

相关推荐

12-15 12:50
河北工程大学
sta666:我也是这个国际商业化的,三天,一天一面,就通过了,不过我是后端实习生,好好面感觉能过。
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务