Strings

  • + 0 comments

    int main() { std::string a; std::string b; std::cin>>a; std::cin>>b;

    std::cout<<a.size()<<" "<<b.size()<<std::endl;
    std::cout<<a+b<<std::endl;
    
    std::string first_char_of_a = {a[0]};
    std::string second_char_of_b = {b[0]};
    
    std::cout<<a.replace(0,1, second_char_of_b)<<" "<<b.replace(0,1,first_char_of_a)<<std::endl;
    
    return 0;
    

    }