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.
int main() {
// Complete the program
// Declare Variable
string a, b;
// For Input
cin >> a >> b;
// Output..
cout << a.size() << " " << b.size() << endl;
cout << a + b << endl;
char first_char_a = a[0];
char first_char_b = b[0];
a[0] = first_char_b;
b[0] = first_char_a;
// Again Output
cout << a << " " << b << endl;
return 0;
HackerRank is such a solid platform for coding practice! Cricket 99 club
include
include
using namespace std;
int main() { // Complete the program // Declare Variable string a, b; // For Input cin >> a >> b; // Output.. cout << a.size() << " " << b.size() << endl; cout << a + b << endl;
}
Solution without tmp variable;