热门

最新

红包

立Flag

投票

同城

我的

发布
2201_75435309
科院计科212黄录松2103103030
4 年前
true2201_75435309

for(int i = 1; i <= 10; ++ i)
ListInsert_Sq(L, i, i);
int operationNumber; //操作次数
scanf("%d", &operationNumber);
while(operationNumber != 0)
{
int operationType; //操作种类
scanf("%d", & operationType);
if(operationType == 1)
{
int pos, elem;//增加操作
scanf("%d%d", &pos, &elem);
ListInsert_Sq(L, pos, elem);
}
else
if(operationType == 2)
{
int pos; ElemType elem; //删除操作
scanf("%d", &pos);
ListDelete_Sq(L, pos, elem);
printf("%d\n", elem);
}
else
if(operationType == 3)
{
ElemType elem; //查找定位操作
scanf("%d", &elem);
int pos = ListLocate_Sq(L, elem);
if(pos >= 1 && pos <= L.length)
printf("%d\n", pos);
else
printf("NOT FIND!\n");
}
else
if(operationType == 4)
{
ListPrint_Sq(L); //输出操作
}
operationNumber--;
}
return 0;
}

CSDN App 扫码分享
分享
评论
点赞
打赏
  • 复制链接
  • 举报
下一条:
无意间翻到了2015年写的Android框架——AFrame,涵盖四大核心模块:Activity、图片/视频/文件资源加载,数据存储和网络请求。这代码写的现在看来也是挺规范的吧,
立即登录