    #include <algorithm>
    #include <cctype>
    #include <string>
    #include <iostream>
    
    using namespace std;
    int main()
    {
        string text = "Abc123DEfHello";
        cout << text <<  "\n";
        //...
        std::transform(text.begin(), text.end(), text.begin(), [](char c) 
          { return isupper(c)?tolower(c):toupper(c); });
        cout << text <<  "\n";
    }