Pagini recente » Cod sursa (job #2519586) | Cod sursa (job #1113917) | Cod sursa (job #3122178) | Cod sursa (job #1145411) | Cod sursa (job #3212205)
// ConsoleApplication2.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <fstream>
#include <vector>
#include <string>
using namespace std;
ifstream cin("strmatch.in");
ofstream cout("strmatch.out");
string A, B;
int pos;
vector <int> app;
int main() {
cin >> A >> B;
pos = B.find(A);
while (pos != string::npos)
{
app.push_back(pos);
pos = B.find(A, pos + 1);
}
cout << app.size() << "\n";
for(int i=0;i<app.size();i++)
cout << app[i] << " ";
return 0;
}