0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-09 01:18:47 +00:00
OI-codes/AcWing/16/16.cpp

13 lines
242 B
C++
Raw Normal View History

class Solution {
public:
string replaceSpaces(string &str) {
string res;
for (auto c : str)
if (c == ' ')
res += "%20";
else
res += c;
return res;
}
};