What is the output of the following C++ program when the input is 25⏎ Asha Rao⏎?
#include <iostream>
#include <string>
int main() {
int age;
std::string name;
std::cin >> age;
std::getline(std::cin >> std::ws, name);
std::cout << age << " [" << name << "] " << name.size() << '\n';
return 0;
}
std::ws skips the newline and the leading spaces, then getline reads the rest of the line. Spaces inside the name are kept.