Cod sursa(job #2844764)

Utilizator keepcodingTanase Daniel keepcoding Data 5 februarie 2022 13:14:38
Problema Deque Scor 0
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.29 kb
#include <bits/stdc++.h>
using namespace std;

char text[10001], word[10001];

int main () {
    cin.getline(word, 10001);
    cin.getline(text, 10001);
    char *p = strstr(text, word);
    while (p != 0) {
        cout << p - text + 1 << " ";
        p = strstr(p + 1, word);
    } 
    return 0;
}