#include <stdio.h>
#include <process.h>
void main(){
FILE *fp;
char ch,filename[30];
printf("please input filename:\n");
scanf("%s",filename);
if((fp=fopen(filename,"r"))==NULL){
printf("can not open file:\n");
exit(0);
}
ch=fgetc(fp);
while(ch!=EOF){
ch=putchar(ch);
ch=fgetc(fp);
}
rewind(fp);
printf("\n");
ch=fgetc(fp);
while(ch!=EOF){
ch=putchar(ch);
ch=fgetc(fp);
}
printf("\n");
fclose(fp);
}