#include <stdio.h>
main()
{ FILE *fp;
char st [81];
int i;
if ((fp=fopen("text.txt","w+"))==NULL)
{ printf("Cannot open the file!\n"); exit(0);}
for (i=0;i<10;i++)
{ gets(st);
fputs(st,fp); fputs("\n",fp)
}
rewind(fp):
printf("results:\n");
for(i-0;i<10;i++)
{ fgets(st,81,fp);
printf("%s",st);
fclose(fp); }
system("pause");
}