#include
#include
#include
int main()
{
FILE *a,*b,*c;
char ch[100],outfile[10];
int i=0,n;
void paixu(char a[100],int n);
if((a=fopen("A.txt","r"))==NULL)
{
printf("Can't open the file 'A.txt'");
exit(0);
}
if((b=fopen("B.txt","r"))==NULL)
{
printf("Can't open the file 'B.txt'");
exit(0);
}
printf("
请输入输出的文件名:
");
scanf("%s",outfile);
if((c=fopen(outfile,"w"))==NULL)
{
printf("Can't open the file %s",outfile);
exit(0);
}
while(!feof(a))
ch[i++]=fgetc(a);
while(!feof(b))
ch[i++]=fgetc(b);
n=strlen(ch);
paixu(ch,n);
for(i=0;i
fputc(ch[i],c);
fclose(a);
fclose(b);
fclose(c);
return 0;
}
void paixu(char a[100],int n)
{
int i,j;
char temp;
for(i=0;i