#include <iostream>
#include <string>
using namespace std;
int main() {
string x;
cout << "Wpisz na wejściu, jak masz na imię? " << endl;
getline(cin, x);
cout << x << endl;
cout << "Twoje imię składa się z " << x.size()
<< " liter" << endl;
int ilespacji = 0;
char spacja = ' ';
for (int i = 0; i < x.size(); i++)
if (x[i] == spacja)
ilespacji++;
cout << "w tym " << ilespacji << " spacji";
}
To embed this project on your website, copy the following code and paste it into your website's HTML: