数据结构上机测试1:顺序表的应用
来源:互联网 发布:江苏计算机二级vb真题 编辑:程序博客网 时间:2024/06/08 14:33
#include<iostream>#include<algorithm>using namespace std;const int maxn=10010;typedef struct{ int *emue; int lengh;}lis;void initlist(lis *L){ L->emue=new int [maxn]; L->lengh=0;}void creat(lis &L, int k){ L.lengh=k; for(int i=0;i<L.lengh;i++) { cin>>L.emue[i]; }}void del(lis &L, int k){ for(int i=k;i<L.lengh-1;i++) L.emue[i]=L.emue[i+1]; L.lengh--;}void loclist(lis &L){ for(int i=0;i<L.lengh-1;i++) for(int j=i+1;j<L.lengh;j++) { if(L.emue[i]==L.emue[j]) { del(L, j); j--; } }}int main(){ lis L; int n, m; cin>>m; initlist(&L); ///å��å§�å��顺åº�表 creat(L, m); ///ç»�顺åº�表èµ�å�¼ loclist(L); ///å� é�¤é��å¤�å��ç´ cout<<L.lengh<<endl; for(int i=0;i<L.lengh-1;i++) cout<<L.emue[i]<<" "; cout<<L.emue[L.lengh-1]<<endl; return 0;}
0 0
- 数据结构上机测试1:顺序表的应用
- 1130数据结构上机测试1:顺序表的应用
- 1130 数据结构上机测试1:顺序表的应用
- 数据结构上机测试1:顺序表的应用
- 数据结构上机测试1:顺序表的应用
- 数据结构上机测试1:顺序表的应用
- 数据结构上机测试1:顺序表的应用
- 数据结构上机测试1:顺序表的应用
- 数据结构上机测试1:顺序表的应用!!!
- 数据结构上机测试1:顺序表的应用
- 数据结构上机测试1:顺序表的应用
- 数据结构上机测试1:顺序表的应用
- 数据结构上机测试1:顺序表的应用
- 数据结构上机测试1:顺序表的应用
- 数据结构上机测试1:顺序表的应用
- SDUToj1130数据结构上机测试1:顺序表的应用
- 数据结构上机测试1:顺序表的应用
- 【1130】数据结构上机测试1:顺序表的应用
- WPF平台Grid控件性能比较
- Hibernate中Criteria的完整用法
- JAVA单例模式
- NUBT 1651 Red packet(红包问题,二分,宁波工程学院在线评测)
- MongoDB数据类型
- 数据结构上机测试1:顺序表的应用
- notepad++ 设置
- HDU 5754 Life Winner Bo (各种博弈融合)
- spring注解
- leetcode ----Intersection of Two Arrays
- 数据结构实验之链表二:逆序建立链表
- Jackson常用注解介绍
- 树莓派 让vim支持python
- 1088. Rational Arithmetic (20)