文章

221

粉丝

0

获赞

64

访问

8.1k

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

//栈
#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...

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发