简单字符串。
1 #include <cstdio> 2 #include <cstring> 3 4 #define MAXLEN 105 5 #define MAXN 25 6 7 char keys[MAXN][MAXN]; 8 char lines[MAXN][MAXLEN]; 9 int nums[MAXN]; 10 11 int main() { 12 int case_n = 0; 13 int n, m, max; 14 int i, j, k, v; 15 char tmp[MAXLEN]; 16 17 while (scanf("%d %d",&n,&m) != EOF) { 18 for (i=0; i<n; ++i) 19 scanf("%s", keys[i]); 20 getchar(); 21 memset(nums, 0, sizeof(nums)); 22 max = -1; 23 for (i=0; i<m; ++i) { 24 gets(lines[i]); 25 v = 0; 26 for (j=0; j<strlen(lines[i]); ++j) { 27 if (lines[i][j]>='A' && lines[i][j]<='Z') { 28 tmp[v++] = lines[i][j]-'A'+'a'; 29 } else if (lines[i][j]>='a' && lines[i][j]<='z') { 30 tmp[v++] = lines[i][j]; 31 } else { 32 if (v) { 33 tmp[v++] = '