2016년 6월 8일 수요일

이것이 c언어다. 13장 단어추출


#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;

}



댓글 없음:

댓글 쓰기