Code:
#include <algorithm>
#include <string>
#include <iostream>
#include <cctype>
int main()
{
std::string s;
std::cout << "Hello there! Input some words: ";
std::getline(std::cin, s);
std::transform(s.begin(), s.end(), s.begin(), &std::tolower);
std::cout << "You entered: " << s << std::endl;
}
Hello there! Input some words: Hello There World!
You entered: hello there world!
Code:
#include <algorithm>
#include <string>
#include <iostream>
#include <cctype>
int main()
{
std::string s;
std::cout << "Hello there! Input some words: ";
std::getline(std::cin, s);
std::transform(s.begin(), s.end(), s.begin(), &std::toupper);
std::cout << "You entered: " << s << std::endl;
}
Hello there! Input some words: Hello There World!
You entered: HELLO THERE WORLD!