解题思路:
注意事项:
参考代码:
#include<iostream> #include<set> #include<algorithm> #include<string> using namespace std; string s1; set<string> st; void alls() { for(int i=0;i<=s1.size()-8;i++) { st.insert(s1.substr(i,8)); } // for(set<string>::iterator it=st.begin();it!=st.end();it++) // { // cout<<*it<<endl; // } } int main() { int n; string s2; int as=0; cin>>s1>>n; alls(); for(int i=0;i<n;i++) { cin>>s2; sort(s2.begin(),s2.end()); do { if(st.count(s2)) { as++; } } while(next_permutation(s2.begin(),s2.end())); } cout<<as<<endl; return 0; }
0.0分
0 人评分
C语言程序设计教程(第三版)课后习题11.3 (C语言代码)浏览:1048 |
字符串的输入输出处理 (C语言代码)浏览:922 |
C语言程序设计教程(第三版)课后习题6.10 (C语言代码)浏览:1051 |
Cylinder (C语言描述,蓝桥杯)浏览:1247 |
C二级辅导-阶乘数列 (C语言代码)浏览:508 |
震宇大神的杀毒软件 (C语言代码)浏览:1079 |
C语言程序设计教程(第三版)课后习题12.3 (C语言代码)浏览:542 |
C语言训练-8除不尽的数 (C语言代码)浏览:1396 |
1162答案错误,为什么浏览:638 |
小O的乘积 (C++代码)浏览:745 |