解题思路:
注意事项:
参考代码:
#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语言代码)浏览:1520 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:464 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:616 |
WU-复数求和 (C++代码)浏览:2015 |
wu-理财计划 (C++代码)浏览:835 |
2004年秋浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:1341 |
Cylinder (C语言描述,蓝桥杯)浏览:1247 |
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:547 |
2004年秋浙江省计算机等级考试二级C 编程题(1) (C语言代码)浏览:600 |
杨辉三角 (C语言代码)浏览:484 |