Pagini recente » Cod sursa (job #2138717) | Cod sursa (job #766472) | Cod sursa (job #893854) | Cod sursa (job #2690805) | Cod sursa (job #538386)
Cod sursa(job #538386)
#include<fstream.h>
#include<string.h>
#include<stdlib.h>
ifstream fin("date.in");
ofstream fout("date.out");
char a[1000],b[1000], *x;
int nr;
int main()
{
fin.getline(a,1000);
fin.getline(b,1000);
x=strstr(b,a);
nr++;
while(x)
{
x=strstr(strlen(b)+x,a);
nr++;
}
fout<<nr<<'\n';
x=strstr(b,a);
fout<<x<<' ';
while(x)
{
//x=strstr(strlen(b)+x,a);
fout<<x-a<<' ';
}
return 0;
}