本文最后更新于 2189 天前,其中的信息可能已经有所发展或是发生改变。
#include<iostream>
using namespace std;
int main(){
char arr[1000000];
cout<<"please input"<<endl;
cin>>arr;
char temp[8];
int n,sum1=0;
cin>>n;
for(int i=0;i<n;i++){
cin>>temp;
char temp1[8][2];
for(int k=0;k<8;k++){
temp1[k][0]=temp[k];
temp1[k][1]='0';
}
int j=0;
while(arr[j+7]!='\0'){
int sum=0;
for(int k=0;k<8;k++){
temp1[k][1]='0';
}
for(int k=0;k<8;k++){
for(int q=0;q<8;q++){
if(arr[j+k]==temp1[q][0]&&temp1[q][1]=='0'){
sum++;
temp1[q][1]='1';
cout<<"arr[j+k] j+k="<<j+k<<arr[j+k]<<"temp1[q][0] q="<<temp1[q][0]<<endl;
break;
}
}
}
if(sum==8){
sum1++;
cout<<"j="<<j<<endl;
}
j++;
cout<<"count_j="<<j<<endl;
}
}
cout<<sum1;
return 0;
}