#include <stdio.h>
#include <string.h>
int main(void)
{
char szSentence[80];
char *ptemp = NULL;
char *pSavedTemp = "";
char szSeparator[] = " ,.\n\t";
printf("enter the sentence : ");
gets(szSentence);
ptemp = strtok_s(szSentence,szSeparator,&pSavedTemp);
while(ptemp != NULL)
{
printf("%s\n",ptemp);
ptemp = strtok_s(NULL,szSeparator,&pSavedTemp);
}
return 0;
}
댓글 없음:
댓글 쓰기