Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int search(char *srt1, char *str2);
- int main()
- {
- char str1[12] = { "abcdefghigk" };
- char str2[7] = { "abcdef" };
- printf("%d\n", search(str1, str2, k));
- getchar();
- return 0;
- }
- int search(char *str1, char *str2)
- {
- int minus = 0;
- for (int i = 0; i < 11; i++)
- {
- k++;
- for (int j = 0; j < 6; j++)
- {
- if (str1[i] - '0' == str2[j] - '0')
- {
- minus = 1;
- }
- k = k - minus;
- minus = 0;
- }
- }
- return k;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement