diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..1868be1 --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,14 @@ +{ + "configurations": [ + { + "cStandard": "c18", + "compilerPath": "C:\\Program Files\\mingw64\\mingw64\\bin\\gcc.exe", + "includePath": [ + "${workspaceFolder}/**" + ], + "intelliSenseMode": "windows-gcc-x64", + "name": "Win32" + } + ], + "version": 4 +} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..9e1c32d --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,26 @@ +{ + "configurations": [ + { + "MIMode": "gdb", + "args": [], + "cwd": "${fileDirname}", + "environment": [], + "externalConsole": false, + "internalConsoleOptions": "neverOpen", + "miDebuggerPath": "C:\\Program Files\\mingw64\\mingw64\\bin\\gdb.exe", + "name": "gcc single file debug", + "preLaunchTask": "gcc single file build", + "program": "${fileDirname}\\${fileBasenameNoExtension}.exe", + "request": "launch", + "setupCommands": [ + { + "ignoreFailures": true, + "text": "-enable-pretty-printing" + } + ], + "stopAtEntry": false, + "type": "cppdbg" + } + ], + "version": "0.2.0" +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..8717562 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,41 @@ +{ + "options": { + "env": { + "Path": "C:\\Program Files\\mingw64\\mingw64\\bin;${env:Path}" + }, + "shell": { + "args": [ + "/C" + ], + "executable": "C:\\Windows\\System32\\cmd.exe" + } + }, + "tasks": [ + { + "args": [ + "-std=c18", + "-g", + "${file}", + "-o", + "${fileDirname}\\${fileBasenameNoExtension}.exe" + ], + "command": "C:\\Program Files\\mingw64\\mingw64\\bin\\gcc.exe", + "group": { + "isDefault": true, + "kind": "build" + }, + "label": "gcc single file build", + "presentation": { + "clear": true, + "echo": false, + "focus": false, + "panel": "shared", + "reveal": "silent", + "showReuseMessage": false + }, + "problemMatcher": "$gcc", + "type": "process" + } + ], + "version": "2.0.0" +} \ No newline at end of file diff --git a/README.en.md b/README.en.md deleted file mode 100644 index 8d9b674..0000000 --- a/README.en.md +++ /dev/null @@ -1,36 +0,0 @@ -# 408-所有真题算法 - -#### Description -{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**} - -#### Software Architecture -Software architecture description - -#### Installation - -1. xxxx -2. xxxx -3. xxxx - -#### Instructions - -1. xxxx -2. xxxx -3. xxxx - -#### Contribution - -1. Fork the repository -2. Create Feat_xxx branch -3. Commit your code -4. Create Pull Request - - -#### Gitee Feature - -1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md -2. Gitee blog [blog.gitee.com](https://blog.gitee.com) -3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) -4. The most valuable open source project [GVP](https://gitee.com/gvp) -5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) -6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/README.md b/README.md index 84bdc7e..cb102c0 100644 --- a/README.md +++ b/README.md @@ -1,39 +1,3 @@ # 408-所有真题算法 -#### 介绍 -{**以下是 Gitee 平台说明,您可以替换此简介** -Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台 -无论是个人、团队、或是企业,都能够用 Gitee 实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)} - -#### 软件架构 -软件架构说明 - - -#### 安装教程 - -1. xxxx -2. xxxx -3. xxxx - -#### 使用说明 - -1. xxxx -2. xxxx -3. xxxx - -#### 参与贡献 - -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request - - -#### 特技 - -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 -5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) +2009-2021 算法题 \ No newline at end of file diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..e66c42b --- /dev/null +++ b/main.cpp @@ -0,0 +1,40 @@ +#include +#include +#include + +void printArr(int a[], int n) { + for (int i = 0; i < n; i++) { + printf("%d ", a[i]); + } +} + +int Partition(int A[], int low, int high) { + int pivot = A[low]; //ѡȡһΪ + while (low < high) { + while (low < high && A[high] >= pivot) + high--; + A[low] = A[high]; + while (low < high && A[low] <= pivot) + low++; + A[high] = A[low]; + } + A[low] = pivot; + return low; +} +void QuickDivideSort(int A[], int low, int high, int n) { + if (low < high) { + int pivot = Partition(A, low, high); + if (pivot < n / 2) + QuickDivideSort(A, pivot + 1, high, n); + else + QuickDivideSort(A, low, pivot - 1, n); + } +} + +int main() { + int sort[] = { 2, 3, 3, 5, 6, 7, 1, 1, 1, 1, 1 }; + int n = sizeof(sort) / 4; + QuickDivideSort(sort, 0, n - 1, n); + printArr(sort, 11); + return 0; +} diff --git a/main.exe b/main.exe new file mode 100644 index 0000000..4d4acfb Binary files /dev/null and b/main.exe differ diff --git a/newMain.cpp b/newMain.cpp new file mode 100644 index 0000000..6d06ec4 --- /dev/null +++ b/newMain.cpp @@ -0,0 +1,5 @@ +#include +int main() { + printf("hello"); + return 0; +} \ No newline at end of file diff --git a/newMain.exe b/newMain.exe new file mode 100644 index 0000000..7e3dd14 Binary files /dev/null and b/newMain.exe differ