We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
#include<iostream>#include<string>usingnamespacestd;intmain(){stringa,b;cin>>a>>b;// First line: lengths of a and bcout<<a.length()<<" "<<b.length()<<endl;// Second line: concatenated stringcout<<a+b<<endl;// Third line: swap first characters of a and bchartemp=a[0];a[0]=b[0];b[0]=temp;cout<<a<<" "<<b<<endl;return0;}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Strings
You are viewing a single comment's thread. Return to all comments →