#include <stdio.h>
#include <string.h>
#include <stdlib.h>
//#include <windows.h>
int main ()
{
FILE *pFile1=fopen("..\\a.txt","rb");
FILE *pFile2=fopen("..\\b.txt","rb");
FILE *pFile3=fopen("..\\ab.txt","wb");
char bf1[48]={0};
char bf2[4096]={0};
char bf3[4196]={0};
int i=0,j=0;
blo: while(fgets(bf1,48,pFile1)!=NULL)
{
i=atoi(bf1);
//printf ("%d\n",i);
while(fgets(bf2,4096,pFile2)!=NULL)
{
// strcpy(bf3,bf1);
//strcat(bf3,bf2);
//strcat(bf2,"\n\n");
int k=strlen(bf2);
j++;
if(j==i)
{
//fwrite(bf2,1,k,pFile3);
fputs(bf2,pFile3);
goto
blo;
}
memset(bf2,0,4096);
}
}
fclose(pFile1);
fclose(pFile2);
fclose(pFile3);
//Sleep(3000);
return 0 ;
}