C
c
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
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
// by using the strchr character search function
int main() {
char slinwords[1000];
fgets( slinwords, sizeof(slinwords), stdin );
char* cwordb = slinwords;
char* cworde = strchr(cwordb, ' ');
char* cline = strchr(slinwords, 0);
int ilenw = 0;
char cword[1000];
if(cline!=cwordb)
do {
cworde = strchr(cwordb, ' ');
ilenw = (cworde?cworde:cline)-cwordb;
memcpy(cword,cwordb,ilenw);
cword[ilenw]=0;
//work with word
//
printf("\"%s\"\n",cword);
if(cworde)cwordb = cworde + 1;
} while ( cworde != NULL );
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run