From 4827456057f054d16f593ccef4a7ff3724886d66 Mon Sep 17 00:00:00 2001 From: XiaoLFeng Date: Sat, 20 May 2023 16:55:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 ++ main.cpp | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 .gitignore create mode 100644 main.cpp diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e30bef3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# 项目排除路径 +/cmake-build-debug/ \ No newline at end of file diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..aeae15b --- /dev/null +++ b/main.cpp @@ -0,0 +1,56 @@ +/* + * + */ + +#include +#define MAXSIZE 100 + +typedef struct { + int data[MAXSIZE]; + int length; +} ArrayList; + +// ³õʼ»¯ÏßÐÔ±í +void InitList(ArrayList &L) { + L.length = 0; +} + +// Ïú»ÙÏßÐÔ±í +void DestroyList(ArrayList &L) { } + +// °´Ë³Ðò²åÈëÏßÐÔ±í +// ÓÃÀ´ÊäÈëÒ»¸öµÝÔöÓÐÐòÏßÐÔ±í£¨ÓɼüÅÌÊäÈën¸öÕûÊý£©£» +void PutSeqList(ArrayList &L,int n) { + // Åжϵ±Ç°ÏßÐÔ±í¼ÓÈën¸öÄÚÈÝÊÇ·ñÒç³ö + if (L.length + n >= MAXSIZE) { + printf("[WARNING] ÏßÐÔ±í³¬³öÏÞÖÆ´óС£¬ÇëÖØÊÔ"); + return; + } + // Ñ­»·¼ÓÈëÊý¾Ý + +} + +int LengthList(ArrayList &L) { + +} + +int PositionList(ArrayList &L,int x) { + +} + +int InsertList(ArrayList &L,int i,int e) { + +} + +void OutputSeqList(ArrayList &L) { + +} + +int main() { + ArrayList list; + InitList(list); + + DestroyList(list); + return 0; +} +