#include <iostream>
#include <string>
using namespace std;
int main() {
   string tekst ="nauka";
    tekst.insert(5, "C++"); //indeksy: n(0) a(1) u(2) k(3) a(4) - przed a(4)?
    //Uwaga: przed znakiem o indeks 5 (czyli za ostatnim znakiem "nauka")
    //Chcemy przedostatnie 'a'? Poprawmy dla przykładu: przed 4.
    //Dla jesności: przed literą 'a' (indeks 4)
    //Poprawka _ wstawiamy przed 4:
    tekst = "nauka";
    tekst.insert(4, "C++");
    cout << tekst << endl; // nauC++ ka
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: