Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cctype>
- #include <string>
- #include <iostream>
- using namespace std;
- string initials(string tekst)
- {
- string wynik = " ";
- wynik[0] = tekst[0];
- for(unsigned i = 0; i < tekst.size(); ++i)
- {
- if(tekst[i] == ' ')
- wynik += tekst[i + 1];
- }
- return wynik;
- }
- int main()
- {
- cout << initials("Piotr Kowalski") << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment