Program | WILDC.PAS, WILDC.C, WILDC.CPP |
In everyday live we often use wildcards when e.g. searching strings in a file
(ra?unalnik) or specify a set of filenames (*.txt). Typically, when specifying
wildcard strings, two special charactes are used:
'*' matching zero or more charactes and '?' matching any single character.
Examples of matching:
data string wildcard string abcdefg = abcdefg abcdefg = abc* abcdefg = abc?efg abcdefgh = ab?*e*f?h abcdefgh = * abcdefg = ???????
The task is to write a program counting the number of successful matches between strings and wildcards.
Input:
3
data-string wildcard-string
*string*string
Incorrect Example
????????????????
a
a
Output:
2