Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- const int N = 510;
- char S[N], T[N];
- int main()
- {
- int n, m;
- scanf("%d %s%d", &n, S, &m);
- int best = -1, bestix;
- for (int i = 1; i <= m; ++i) {
- scanf(" %s", T);
- int cnt = 0;
- for (int j = 0; j < n; ++j) {
- if (S[j] == T[j])
- ++cnt;
- }
- if (i > 1) printf(" ");
- printf("%d", cnt);
- if (cnt > best) {
- best = cnt;
- bestix = i;
- }
- }
- printf("\n#%d: %d\n", bestix, best);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement