#include <cstdio>void squeeze(char a[], int n)
{
int i, j;
for (i = j = 0; a[i] != '0'; i++)
if (a[i] != 'c')
a[j++] = a[i];
a[j] = '\0';
}
int main()
{
char a[10];
for (int i = 0; i <= 9; i++)
scanf_s("%c", a + i);
squeeze(a, 9);
for (int i = 0; i <= 9; i++)
printf("%c", a[i]);
}
stract
voidstrcat(char a[], char b[])
{
int i, j;
i = j = 0;
while (a[i] != '\0')
i++;
while ((a[++i] = b[j++]) != '\0')
;
}
shellsort
void shellsort(int v[], int n)
{
int gap, i, j, temp;
for(gap = n/2 ; gap >0 ; gap /=2)//每比较两个数之间的间隔for(i = gap; i <n; i++) //在元素间移动位置for (j = i - gap; j >= 0 && v[j] > v[j + gap]; j -= gap) { //每个间隔从0开始 每次加1
temp = v[j];
v[j] = v[j + gap];
v[j + gap] = temp;
for (int i = 1; i <= 10; i++) {
printf("%d ", a[i]);
}
printf("\n`````````
);
}
}
```
int strindex(char a[], char b[])
{
for ( int i; a[i]; a++) {
for (int j = i, k = 0; b[k] != '\0' && a[j] == b[k]; j++, k++)
;
if (b[k] == '\0')
return i;
}
return -1;
}