mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-12-12 05:26:28 +00:00
13 lines
242 B
C++
13 lines
242 B
C++
|
class Solution {
|
||
|
public:
|
||
|
string replaceSpaces(string &str) {
|
||
|
string res;
|
||
|
for (auto c : str)
|
||
|
if (c == ' ')
|
||
|
res += "%20";
|
||
|
else
|
||
|
res += c;
|
||
|
return res;
|
||
|
}
|
||
|
};
|