08 - 字符串的输入

#include <stdio.h>
#define STLEN 5
int main()
{
   char words[STLEN];

   puts("Enter strings (empty line to quit):");
   while(fgets(words, STLEN, stdin) != NULL && words[0] != '\n')
   {
        fputs(words, stdout);
   }
   puts("Done.");


   return 0;
}


一:输入wwww

输出:

wwwwdone 

猜你喜欢

转载自blog.csdn.net/wjh8925750/article/details/82828985