国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

???

2023-06-23 23:22 作者:furiousiTy  | 我要投稿

#include <iostream>

#include <stack>

#include <string>


std::string removeDuplicates(const std::string& input) {

? ? std::stack<char> stack;


? ? for (char c : input) {

? ? ? ? if (isdigit(c)) { // 判斷字符是否是數(shù)字

? ? ? ? ? ? if (stack.empty() || stack.top() != c) {

? ? ? ? ? ? ? ? stack.push(c);

? ? ? ? ? ? }

? ? ? ? }

? ? }


? ? std::string result;

? ? while (!stack.empty()) {

? ? ? ? result = stack.top() + result;

? ? ? ? stack.pop();

? ? }


? ? return result;

}


int main() {

? ? std::string input = "a1b22c333d4444e55555";

? ? std::string result = removeDuplicates(input);

? ? std::cout << "Original string: " << input << std::endl;

? ? std::cout << "String after removing duplicates: " << result << std::endl;


? ? return 0;

}


???的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國家法律
门头沟区| 九龙坡区| 浦东新区| 铜山县| 红河县| 呈贡县| 绥滨县| 泊头市| 长垣县| 尉犁县| 潜山县| 咸宁市| 山西省| 龙南县| 库尔勒市| 呼伦贝尔市| 资源县| 凌云县| 泰来县| 个旧市| 迭部县| 大庆市| 萨嘎县| 腾冲县| 甘泉县| 习水县| 徐闻县| 合作市| 雅江县| 江安县| 无棣县| 彭阳县| 简阳市| 咸宁市| 榆中县| 灵山县| 湄潭县| 蕲春县| 乐都县| 团风县| 凤翔县|