#include <stdio.h>
#include<stdlib.h>
#define LEN 21
int main ()
{
	FILE *fp;
	char ch,buffer[LEN];
	if(!(fp=fopen("fishc.txt","at+")))
	{
		printf("Cannot open file strike any key exit!");
		exit(1);
	}
	printf("Please input a string :\n");
	fgets(buffer,LEN,stdin);
	fputs(buffer,fp);

	rewind(fp);

	ch=fgetc(fp);
	while(ch!=EOF)
	{
		putchar(ch);
		ch=fgetc(fp);
	}
	fclose(fp);
	return 0;
}