diff --git a/AcWing/16/16.cpp b/AcWing/16/16.cpp new file mode 100644 index 00000000..52ed2f08 --- /dev/null +++ b/AcWing/16/16.cpp @@ -0,0 +1,12 @@ +class Solution { + public: + string replaceSpaces(string &str) { + string res; + for (auto c : str) + if (c == ' ') + res += "%20"; + else + res += c; + return res; + } +};