标签:lower logs div hdu with res max com form
1 #include <iostream> 2 #include<cstdio> 3 #include<cmath> 4 #include<cstring> 5 #include<string> 6 7 using namespace std; 8 9 char a[55],b[55]; 10 int n,len1,len2,res; 11 12 bool digital(int i,int j) 13 { 14 //结尾判定 15 if(i==len1&&j==len2) 16 return true; 17 else if(i==len1||j==len2) 18 return false; 19 //中间过程 20 else if(a[i]==‘*‘) 21 { 22 for(int k=j;k<=len2;k++) 23 if(digital(i+1,k)) 24 return true; 25 } 26 else if(a[i]==‘?‘||a[i]==b[j]) 27 digital(i+1,j+1); 28 else 29 return false; 30 } 31 32 int main() 33 { 34 while(scanf("%s",&a)!=EOF) 35 { 36 scanf("%d\n",&n); 37 len1=strlen(a); 38 res=0; 39 while(n--) 40 { 41 scanf("%s",&b); 42 len2=strlen(b); 43 if(digital(0,0)) 44 res++; 45 } 46 printf("%d\n",res); 47 } 48 return 0; 49 }
标签:lower logs div hdu with res max com form
原文地址:http://www.cnblogs.com/Annetree/p/7144816.html