#include <iostream>
#include <string>
using namespace std;
int main() {
string zdanie;
cout<<"Podaj zdanie: ";
getline(cin, zdanie);
size_t dlugosc = zdanie.length();
size_t pozycjaSpacji = zdanie.find(' ');
string wynik = zdanie + " -> dlugosc: " + to_string(dlugosc);
cout <<"Dlugosc lancucha: " << dlugosc << endl;
if (pozycjaSpacji != string::npos)
cout << "Pierwsza spacja na pozycji: "<< pozycjaSpacji << endl;
else
cout<<"Brak spacji"<<endl;
cout<<"Po kontenancji: "<<wynik<<endl;
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: