You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
519 B
27 lines
519 B
8 months ago
|
#include <stdio.h>
|
||
|
|
||
|
#define IN 1 /* внутри слова */
|
||
|
#define OUT 0 /* вне слова */
|
||
|
|
||
|
int main()
|
||
|
{
|
||
|
int c, nl, nw, nc, state;
|
||
|
state = OUT;
|
||
|
nl = nw = nc = 0;
|
||
|
|
||
|
while ((c = getchar()) != EOF) {
|
||
|
if (c == ' ' || c == '\n' || c == '\t'){
|
||
|
state = OUT;
|
||
|
printf("%c \n",c);
|
||
|
}
|
||
|
else if (state == OUT) {
|
||
|
state = IN;
|
||
|
printf("%c",c);
|
||
|
}
|
||
|
else {
|
||
|
printf("%c",c);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return 0;
|
||
|
}
|