1、#include#include char JFjiami(char ch,int n)while(ch=Areturn ch;void menu()printf(“n=“);printf(“n 1.JFjiami the file“);printf(“n 2.CFljiami the file“);printf(“n 3.JFjiemi the file“);printf(“n 4.CFjiemi the file“);printf(“n 5.Quitn“);printf(“=n“);printf(“Please input a number rang from 1 to 5 and sel
2、ect a item:“);return;void main()int i,n;char ch0,ch1;FILE *in,*out;char infile20,outfile20;sleep(3);menu();ch0=getch();while(ch0!=5)if(ch0=1)clrscr();printf(“nPlease input the infile:“);scanf(“%s“,infile);if(in=fopen(infile,“r“)=NULL)printf(“Can not open the infile!n“);printf(“Press any key to exit!
3、n“);getch();exit(0);printf(“Please input the key:“);scanf(“%d“,printf(“Please input the outfile:“);scanf(“%s“,outfile);if(out=fopen(outfile,“w“)=NULL)printf(“Can not open the outfile!n“);printf(“Press any key to exit!n“);fclose(in);getch();exit(0);while(!feof(in)fputc(JFjiami(fgetc(in),n),out);print
4、f(“nJFjiami is over!n“);fclose(in);fclose(out);sleep(1);if(ch0=2)clrscr();printf(“nPlease input the infile:“);scanf(“%s“,infile);if(in=fopen(infile,“r“)=NULL)printf(“Can not open the infile!n“);printf(“Press any key to exit!n“);getch();exit(0);printf(“Please input the key:“);scanf(“%d“,printf(“Pleas
5、e input the outfile:“);scanf(“%s“,outfile);if(out=fopen(outfile,“w“)=NULL)printf(“Can not open the outfile!n“);printf(“Press any key to exit!n“);fclose(in);getch();exit(0);while(!feof(in)fputc(CFjiami(fgetc(in),n),out);printf(“nCFjiami is over!n“);fclose(in);fclose(out);sleep(1);if(ch0=3)clrscr();pr
6、intf(“nPlease input the infile:“);scanf(“%s“,infile);if(in=fopen(infile,“r“)=NULL)printf(“Can not open the infile!n“);printf(“Press any key to exit!n“);getch();exit(0);printf(“Please input the key:“);scanf(“%d“,printf(“Please input the outfile:“);scanf(“%s“,outfile);if(out=fopen(outfile,“w“)=NULL)pr
7、intf(“Can not open the outfile!n“);printf(“Press any key to exit!n“);fclose(in);getch();exit(0);while(!feof(in)fputc(JFjiemi(fgetc(in),n),out);printf(“nJFjiemi is over!n“);fclose(in);fclose(out);sleep(1);if(ch0=4)clrscr();printf(“nPlease input the infile:“);scanf(“%s“,infile);if(in=fopen(infile,“r“)
8、=NULL)printf(“Can not open the infile!n“);printf(“Press any key to exit!n“);getch();exit(0);printf(“Please input the key:“);scanf(“%d“,printf(“Please input the outfile:“);scanf(“%s“,outfile);if(out=fopen(outfile,“w“)=NULL)printf(“Can not open the outfile!n“);printf(“Press any key to exit!n“);fclose(in);getch();exit(0);while(!feof(in)fputc(CFjiemi(fgetc(in),n),out);printf(“nCFjiemi is over!n“);fclose(in);fclose(out);sleep(1);menu();ch0=getch();clrscr();printf(“nGood Bye!n“);sleep(3);