#include char ord[20], sok[20]; int a, c; int match(int s, int o) { int no; if(sok[s] == ord[o] || (sok[s] == '?' && ord[o] != 0)) { return (sok[s] == 0) ? 1 : match(s+1, o+1); } if(sok[s] == '*') { for(no=o;;no++) { if(match(s+1, no)) return 1; if(ord[no]==0) break; } } return 0; } void main() { printf("S”kstr„ng: "); scanf("%s", sok); FILE *fil = fopen("namn.dat", "rt"); c = 0; for(a=0;a<257;a++) { fscanf(fil, "%s", ord); if(match(0, 0)) { printf("%s\n", ord); c++; } } printf("%d\n", c); fclose(fil); }