This commit is contained in:
xusun000
2021-11-29 12:22:49 +08:00
parent 8c2151b4a5
commit a096521507
9 changed files with 127 additions and 73 deletions

14
.vscode/c_cpp_properties.json vendored Normal file
View File

@@ -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
}

26
.vscode/launch.json vendored Normal file
View File

@@ -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"
}

41
.vscode/tasks.json vendored Normal file
View File

@@ -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"
}

View File

@@ -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/)

View File

@@ -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 算法题

40
main.cpp Normal file
View File

@@ -0,0 +1,40 @@
#include <stdio.h>
#include <stdlib.h>
#include <cstring>
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;
}

BIN
main.exe Normal file

Binary file not shown.

5
newMain.cpp Normal file
View File

@@ -0,0 +1,5 @@
#include<stdio.h>
int main() {
printf("hello");
return 0;
}

BIN
newMain.exe Normal file

Binary file not shown.