Ответ:
Объяснение:
#include <stdio.h>
#include <stdlib.h>
int main()
{
char str1[] = "abcdef";
char str2[] = "ghijklm";
printf("Строка 1: %s\nСтрока 2: %s\nРезультат: %s\n", str1, str2, squeeze(str1, str2));
return 0;
}
void squeeze (char s1[], char s2[])
int i, j, k;
for (i = k = 0; s1[i] != '\0'; i++) {
for (j = 0; s2[j] != '\0' && s2[j] != s1[i]; j++)
;
if (s2[j] == '\0')
s1[k++] = s1[i];
s1[k] = '\0';
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Ответ:
Объяснение:
#include <stdio.h>
#include <stdlib.h>
int main()
{
char str1[] = "abcdef";
char str2[] = "ghijklm";
printf("Строка 1: %s\nСтрока 2: %s\nРезультат: %s\n", str1, str2, squeeze(str1, str2));
return 0;
}
void squeeze (char s1[], char s2[])
{
int i, j, k;
for (i = k = 0; s1[i] != '\0'; i++) {
for (j = 0; s2[j] != '\0' && s2[j] != s1[i]; j++)
;
if (s2[j] == '\0')
s1[k++] = s1[i];
}
s1[k] = '\0';
return 0;
}