#include <stdio.h>
main()
{
FILE *fp1,*fp;
char ch1,ch2;
int i;
char filename[]="L100";
if((fp1=fopen("A","r"))==NULL)
{
printf("Can not open this file!\n");
exit(0);
}
ch1=fgetc(fp1);
i=0;
for(i=0;i<20;i++)
{
if(ch1==EOF)break;
filename[2]=i/10+'0';
filename[3]=i%10+'0';
if((fp=fopen(filename,"w"))==NULL)
{
printf("Can not open this file!\n");
exit(0);
}
while(ch1!=EOF)
{
ch2=fgetc(fp1);
if(ch1=='\n'&&ch2=='A')
{
ch1=fgetc(fp1);
break;
}
fputc(ch1,fp);
ch1=ch2;
}
fclose(fp);
}
fclose(fp1);
}