acgo题库
  • 首页
  • 题库
  • 题单
  • 竞赛
  • 讨论
  • 排行
  • 团队
  • 备赛专区

    竞赛

    • CSP-J/S
    • 蓝桥杯

    考级

    • GESP
    • CPA
    • 电子学会考级
登录
注册
题目详情题解(0)讨论(0)提交记录(0)
  • 标准链表方法

    userId_undefined

    李赛科

    24阅读
    2回复
    1点赞
  • 链表方法

    userId_undefined

    DFZJ

    21阅读
    0回复
    0点赞
  • 数组就行

    userId_undefined

    MuktorFM

    时空双修者出道萌新CSP-S二等奖荣耀黄金出题人
    20阅读
    0回复
    0点赞
  • eeeeeeeee

    #include<bits/stdc++.h> using namespace std; int a[10001]; int main(){ int n; cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; } int x,y;cin>>x>>y; for(int i=1;i<=n;i++){ if(a[i]==x){ cout<<x<<" "<<y<<" "; } else{ cout<<a[i]<<" "; } } return 0; }

    userId_undefined

    Angel是Angle

    4阅读
    0回复
    1点赞
  • 标准链表方法

    #include<iostream> using namespace std; struct node{ int data; node *next; }; int main(){ node *head,*r,*p; head=new node; head->next=NULL; r=head; int n,t; cin>>n; for(int i=1;i<=n;i++){ cin>>t; p=new node; p->data=t; p->next=NULL; r->next=p; r=p; } int m,q; cin>>m>>q; p=head; while(p->next!=NULL){ if(p->next->data==m){ node *t=new node; t->data=q; t->next=p->next->next; p->next->next=t; } p=p->next; } p=head; while(p->next!=NULL){ cout<<p->next->data<<' '; p=p->next; } return 0; }

    userId_undefined

    小码王间谍z号

    3阅读
    0回复
    1点赞
首页