#include <iostream>
#include <string>
#include <algorithm>

int main()
{
   std::string str("Herr Müller ist ein König.");

   std::string findA = "ü";
   std::string replaceWith = "ue";

   size_t pos = 0;
   while ((pos = str.find(findA, pos)) != std::string::npos)
   {
      str.replace(pos, findA.length(), replaceWith);
      pos += replaceWith.length();
   }

    std::cout << str << std::endl;
   return 0;
}
