Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdio>
- #include <cstring>
- using namespace std;
- char s[1000], a[10000];
- int foo(char c)
- {
- if (c >= 'A' && c <= 'Z')
- return (c - 'A' + 'a');
- else
- return c;
- }
- int main()
- {
- int i, y, w, l1, l, z, k;
- freopen("search.in", "r", stdin);
- freopen("search.out", "w", stdout);
- gets(s);
- l = strlen(s);
- z = fread(a, 1, 2000, stdin);
- a[z] = 0;
- //printf("%d", z);
- for ( i = 0; i < z; i++)
- {
- if (foo(a[i]) != foo(s[0]))
- printf("%c", a[i]);
- else
- {
- l1 = 0;
- w = i;
- for (y = 0; y < l; y++)
- {
- k = 0;
- if (s[y] == ' ')
- {
- while (a[w + y] == ' ' || a[y + w] == 9 || a[w + y] == '\n')
- {
- //printf("%d %d ", a[w + y], w);
- w++;
- }
- //y++;
- w--;
- }
- if (foo(a[y + w]) == foo(s[y]))
- {
- l1++;
- }
- else
- {
- // printf("[%c %c]", a[y + w] , s[y]);
- }
- }
- //printf("%d", l1);
- if (l1 == l)
- {
- printf("@");
- }
- printf("%c", a[i]);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement