文章

326

粉丝

4

获赞

551

访问

240.5k

头像
删除字符串 题解:
P1026 贵州大学机试题
发布于 2026年1月
阅读数 566

//栈
#include<stdio.h>
#include<stack>
#include<string.h>
using namespace std;
int main()
{
    char s[110];
    scanf("%s",s);
    int l=strlen(s);
    stack<char> hash;
    for(int i=0;i<l;i++)
    {
        hash.push(s[i]);
        if(hash.size()>=3)
        {
            char top1=hash.top();
            hash.pop();
            char top2=hash.top();
            hash.pop();
            char top3=hash.top();
            hash.pop();
         &nbs...

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发