    #include <iostream>
    #include <string>
    #include <sstream>


    int main(){
        std::string word;
        char letter;
        int i;
        std::cout << "Enter a word: ";
        std::cin >> word;
    
        std::ostringstream leetWord;
        for ( i = 0; i < word.size(); i++)
        {
            if ( word[i] == 'e')
            {
                leetWord << '3';
            }
            else if ( word[i] == 'i' )
            {
                leetWord << '1';
            }
            else if ( word[i] == 'x' )
            {
                leetWord << '*';
            }
            else
            {
            	leetWord << word[i];
            }
        }

        // Here you can refer to the ostringstream::str() function to 
        // get a string
        std::string theWantedString = leetWord.str();
        std::cout << word << " => " << theWantedString << std::endl;
    }
