3.10
来源:互联网 发布:mac jdk tar.gz 安装 编辑:程序博客网 时间:2024/05/22 15:02
#include <iostream>#include <stdlib.h>#define MAX 8using namespace std;typedef struct node{ int num; struct node* pnext;}qnode,*pnode;pnode init(){ int num_; int size=MAX; pnode head,p,q; head=(pnode)malloc(sizeof(qnode)); head->pnext=NULL; q=head; cin>>num_; head->num=num_; size--; while(size--) { p=(pnode)malloc(sizeof(qnode)); cin>>num_; p->num=num_; q->pnext=p; q=p; } q->pnext=head; return head;}void traverse(pnode head){ pnode q=head; int i=0; for(i=0;i<MAX;i++) { cout<<q->num; q=q->pnext; }}pnode find(pnode head,int i){ pnode p=head; int j=1; for(j=1;j<(i-1);j++) { p=p->pnext<<' '; } return p;}void judge(pnode head,int i){ int k=MAX; pnode pra=head,p; if(i==1) { traverse(head); } else { while(k--) { pra=find(pra,i); p=pra->pnext; pra->pnext=p->pnext; pra=p->pnext; cout<<p->num<<' '; free(p); } } }int main(){ int i=1; pnode head; head=init(); judge(head,i);}
0 0
- 3.10
- 3.10
- 3.10
- 3.10
- 3.10
- 【3.10】
- 3.10工作总结
- 习题3.10
- 3.10总结
- 黄迪明3.10
- cpp 3.10
- JCreate Pro 3.10 序列号
- IcebergLock Protector 3.10.1.36
- 3.10 Execute Package任务
- 练习题 3.10 -- Josephus问题
- struts1.3.10配置
- 3.10 循环语句
- struts1.3.10配置
- Python paramiko SFTP协议上传下载文件
- NDK-JNI之初体验
- 【框架-MFC】启动异常- 读取位置 0xfeeefef2 时发生访问冲突
- 记录些多而杂的知识,持续更新
- Error: NDK integration is deprecated in the current plugin.
- 3.10
- FBReader集成后,打开书出现空白页面
- #30 Insert Interval
- Android MediaCodec解码aac,播放.
- qt写的一个计算器程序
- C Peimer第11章编程习题
- 这么多开源框架,该用哪个好?
- 小心了!不是BUG甚是BUG的正则
- Human-level concept learning翻译(2)