首页 > 其他分享 >11111

11111

时间:2024-10-17 16:49:31浏览次数:3  
标签:insert return cout 11111 cin pop int

#include <bits/stdc++.h>
using namespace std;
struct node{
    int d;
    int n;
};
node a[10000]={{0,0},{5,3},{4,5},{3,2},{2,0},{1,4}};
int n=5,i,h=1;
int insert(){尾删
}
int push(int x){头增
    n++;
    a[n].d=x;
    a[n].n=h;
    h=n;
    return 0;
}
int pop(){头删
    h=a[h].n;
    return 0;
}
int weizeng(int x){尾增
    n++;
    i=a[h].n;
    while(a[i].n!=0){
        i=a[i].n;
    }
    a[i].n=n;
    return 0;
}
int display(){输出
    cout<<a[h].d<<" ";
    i=a[h].n;shuchu
    while(a[i].n!=0){
        cout<<a[i].d<<" ";
        i=a[i].n;
    }
    cout<<a[i].d;
}
int main(){
    int x;
    string m;
    
    n=5;h=1;
    while(1){
        cin>>m;
        if(m=="push"){
            cin>>x;
            push(x);
        }
        if(m=="pop"){
            pop();
        }
        if(m=="insert"){
            insert();
        }
        if(m=="weizeng"){
            cin>>x;
            weizeng(x);
        }
        if(m=="display"){
            display();
        }
    }
    
}

标签:insert,return,cout,11111,cin,pop,int
From: https://blog.csdn.net/yuanheng418/article/details/143023390

相关文章

  • 1111111
    软件开发的项目经理:1、基本职责就是确保项目目标的实现,领导项目团队准时、优质地完成全部工作。2、与客户沟通,了解项目的整体需求。并与客户保持一定的联系,即时反馈阶段性的成果,和即时更改客户提出的合理需求。3、制定项目开发计划文档,量化任务,并合理分配给相应的......
  • 111111111111
    Python循环顾名思义就是重复执行某一操作,Python中循环包括while循环和for循环,while循环是通过条件判断来指定循环的范围,for循环采用遍历的形式指定循环范围。 print("3213213213")   1deftest:2a=13test n=0whilen<5:print("你好")n+=1......
  • 11111
    #include<bits/stdc++.h>#include"minecraft.h"#include<Windows.h>usingnamespacestd;TxMinecraftmc;intmain(){boolcon=mc.ConnectMinecraft("zk","4cd7d6e558c943c397a3a5243fa78e19");if(!con){......
  • 11111
    <!DOCTYPEhtml><html> <headlang="en">  <metacharset="UTF-8">  <title>(重复)径向渐变-示例(含参数说明)</title>  <styletype="text/css">    .common{      width:1200px;  ......
  • 11111111
    #include<iostream>#include<vector>#include<windows.h>usingnamespacestd;inta=999;intb=0;boolc=false;structstudent{ stringname; intage; intcard; intgrade;}s;voidka(){ cout<<"学生管理系统:"<<endl; c......
  • test 11111
    MySql分库分表与分区的区别和思考摘要:一.分分合合说过很多次,不要拘泥于某一个技术的一点,技术是相通的。重要的是编程思想,思想是最重要的。当数据量大的时候,需要具有分的思想去细化粒度。当数据量太碎片的时候,需要具有合的思想来粗化粒度。1.1分很多技术都运用了分的编程思想......
  • 速领!京东双11红包今晚20点开抢:每天3次机会 最高11111元
    一年一度的双11大促即将拉开帷幕。10月23日20点,以“真便宜”为主题的京东11.11将正式开启。大家期待的“京享红包”也于今天20点正式发放,连续20天(10月23日-11月11日),每天都可以领取三次,最高可抽11111元现金。具体领取方式如下:京东618京享红包:点此抽红包(每天可抽3次)或京东APP搜......
  • 11111
    torch.manual_seed(seed)os.environ['PYTHONHASHSEED']=str(seed)torch.cuda.manual_seed(seed)torch.cuda.manual_seed_all(seed)np.random.seed(seed)random.seed(seed)torch.backends.cudnn.benchmark=Falsetorch.backends.cudnn.deter......
  • 111111111111
    ##----------PromptGenModule-----------------------classPromptGenBlock(nn.Module):def__init__(self,prompt_dim=128,prompt_len=5,prompt_size=96,lin_dim=192):super(PromptGenBlock,self).__init__()self.prompt_param=nn.Paramet......
  • 111111
    defmake_layer(block,n_layers):layers=[]for_inrange(n_layers):layers.append(block())returnnn.Sequential(*layers)classResidualDenseBlock_5C(nn.Module):def__init__(self,nf=64,gc=32,bias=True):super(Residu......