Pagini recente » Cod sursa (job #3239420) | Cod sursa (job #307000) | Cod sursa (job #2551108) | Cod sursa (job #2679981) | Cod sursa (job #260441)
Cod sursa(job #260441)
#include <stdio.h>
#include <string.h>
int main(){
char A[2000001];
char B[2000001];
int poz=0;
char* c,*b;
FILE *fin=fopen("strmatch.in","r");
FILE *fout=fopen("strmatch.out","w");
fgets(A,2000001,fin);
fgets(B,2000001,fout);
b=B;
while(B!=NULL){
c=strstr(b,A);
poz=poz+(int)(c-b);
b=c;
fprintf(fout,"%d",poz);
}
fclose(fin);fclose(fout);
}