作业帮 > 综合 > 作业

提取出一个英文句子中的所有单词,保存到一个单词数组中.

来源:学生作业帮 编辑:搜搜考试网作业帮 分类:综合作业 时间:2024/06/05 17:30:28
提取出一个英文句子中的所有单词,保存到一个单词数组中.
提取出一个英文句子中的所有单词,保存到一个单词数组中.
以下程序供参考:#include<stdio.h>#include<string.h>intGetWords(char*sentence,char*words[]);voidSortStrings(constchar*strs[],intcount);intmain(){charstr[200];intnWords=0;char*words[20];inti;printf("inputastring:");gets(str);nWords=GetWords(str,words);SortStrings(words,nWords);puts("output:");for(i=0;i<nWords;i++)puts(words[i]);return0;}intGetWords(char*str,char*words[]){//}