可以运行了,你复制上去。
但是警告信息我没理,会发生什么神秘现象,我不知道。
程序代码:
但是警告信息我没理,会发生什么神秘现象,我不知道。
程序代码:#define _STDC_WANT_LIB_EXT1_ 1
#include<stdlib.h>
#include<stdio.h>
#include<string.h>
#include <stdbool.h>
int main()
{
char delimiters[] = "\".,;:!?)(";//确定定界符。
char buf[100];//键盘输入线的缓冲器 。
char str[1000];//
char* ptr = NULL;
size_t str_len = sizeof(str);
size_t buf_len = sizeof(buf);
printf("Enter some prose that less than %zd characters.\n"
"Terminate input by entering an empty line:\n", str_len);
while ( 1 )
{
if (!gets_s(buf, buf_len))
{
printf("Error reading string.\n");
return 1;
}
if (!strnlen_s(buf, buf_len))
break;
if (strcat_s(str, str_len, buf))
{
printf("Mximum permitted input length exceeded.\n");
return;
}
}
printf("the words in the prose that you entered are:\n", str);//找到并列出找到的所有词。
unsigned int word_count = 0;
char * pWord = strtok_s(str, &str_len, delimiters, &ptr);
if (pWord)
{
do
{
printf("%-18s", pWord);
if (++word_count % 5 == 0)
printf("\n");
pWord = strtok_s(NULL, &str_len, delimiters, &ptr);
} while (pWord);
printf("\n%u words found.\n", word_count);
}
else
printf("No woeds found.\n");
system("pause");
return 0;
}

09:30 05/21 种下琵琶种子,能种活么?等待中……
21:50 05/27 没有发芽。
20:51 05/28 没有发芽。
23:03 05/29 没有发芽。
23:30 06/09 我有预感,要发芽了。



