leetcode 2710 移除字符串中的尾随零
1.题目要求:
2.题目代码:
class Solution {
public:
string removeTrailingZeros(string num) {
while(num[num.size() - 1] == '0'){
num.pop_back();
}
return num;
}
};
1.题目要求:
2.题目代码:
class Solution {
public:
string removeTrailingZeros(string num) {
while(num[num.size() - 1] == '0'){
num.pop_back();
}
return num;
}
};