Pagini recente » Cod sursa (job #2428990) | Cod sursa (job #3041855) | Cod sursa (job #2475670) | Cod sursa (job #2802291) | Cod sursa (job #503350)
Cod sursa(job #503350)
#include <cassert>
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
const int MAX_SOL = 1000;
int main() {
assert(freopen("strmatch.in", "r", stdin));
assert(freopen("strmatch.out", "w", stdout));
string needle, hay;
cin >> needle >> hay;
/*
int no_sol = 0, pos = -1;
vector<int> match;
while ((pos = hay.find(needle, pos + 1)) != string::npos) {
if (++no_sol <= MAX_SOL) {
match.push_back(pos);
}
}
cout << no_sol << "\n";
for (vector<int>::iterator it = match.begin(); it != match.end(); ++it) {
cout << *it << " ";
}
*/
}