#include <stdio.h>
#include <string.h>
#define MAX 1000+10
char a[MAX];
int main(void)
{
int i=0;
char c;
while(c=getchar())
{
if(c!='\n' && c!='\0')
a[i++]=c;
else
break;
}
printf("%s\n",a);
return 0;
}
用getchar实现fgets的功能
最新推荐文章于 2024-05-16 09:06:43 发布