Please Login in order to post a comment
using namespace std;
int main() { // Complete the program string a,b; cin>>a; cin>>b; string c=a+b; int len1 = a.size(); int len2 = b.size(); cout<< len1 << " " << len2 <
int main() { // Complete the program string a, b; cin >> a >> b;
// print sizes cout << a.size() << " " << b.size() << endl; // print concatenation cout << a + b << endl; // swap first characters char temp = a[0]; a[0] = b[0]; b[0] = temp; // print after swap cout << a << " " << b << endl; return 0;
}
Here is my code!
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> using namespace std; int main() { string a, b; cin >> a >> b; cout << a.size() << " " << b.size() << "\n"; cout << a + b << "\n"; char temp = a[0]; a[0] = b[0]; b[0] = temp; cout << a << " " << b; return 0; }
HackerRank is such a solid platform for coding practice! Cricket 99 club
Seems like cookies are disabled on this browser, please enable them to open this website
include
include
using namespace std;
int main() { // Complete the program string a,b; cin>>a; cin>>b; string c=a+b; int len1 = a.size(); int len2 = b.size(); cout<< len1 << " " << len2 <
include
include
using namespace std;
int main() { // Complete the program string a,b; cin>>a; cin>>b; string c=a+b; int len1 = a.size(); int len2 = b.size(); cout<< len1 << " " << len2 <
int main() { // Complete the program string a, b; cin >> a >> b;
}
Here is my code!
HackerRank is such a solid platform for coding practice! Cricket 99 club