Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // uloha-7-3.c -- Tyzden 7 - Uloha 3
- // Katarina Rafcikova, 6.11.2014 17:38:01
- #include <stdio.h>
- #define MAX 50
- int main()
- {
- char pole[MAX], c, x, y, z;
- int i = 0, j = 0, velkost = 0;
- while ((c = getchar()) != '\n') {
- if (i < MAX) {
- pole[i] = c;
- i++;
- velkost = i;
- }
- }
- x = getchar();
- y = getchar();
- z = getchar();
- for (i = 0; i < velkost; i++) {
- if ((pole[i] == x) && (pole[i + 1] == y) && (pole[i + 2] == z)) {
- for (j = i; j < velkost; j++) {
- pole[j] = pole[j + 3];
- i = 0;
- }
- velkost -= 3;
- }
- }
- for (i = 0; i < velkost; i++) {
- printf("%c", pole[i]);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement