4 laba

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
int test( int ac, char **av )
{ // \r = 15 \n = 12 (octal)
char buf[ 64 ];
static char str[ 1000 ];
char *d, *p;
char *s;
int f;
d = ac < 2 ? "(), \t" : av[1];
s = ac < 3 ? "; " : av[2];
for (;;) {
&nbs p; f = 0;
gets( buf );
p = xstrtok( buf, d );
if ( !p ) break;
while ( p ) {
if ( *p ) {
if ( f ) strcat( str, s );
strcat( str, xstrlwr( p ) );
f = 1;
}
p = xstrtok( 0, d );
&nbs p; }
strcat( str, "\r\n" );
}
printf( "\r%s", str );
return 6;
}