commit 2f5035a6209ceb81f45c29a0f19e92edab87fae0 Author: James <1943357252@qq.com> Date: Sat Mar 7 13:43:39 2020 +0800 init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7664704 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.bak \ No newline at end of file diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..d97450b --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,16 @@ +{ + "configurations": [ + { + "name": "MinGW", + "intelliSenseMode": "gcc-x64", + "compilerPath": "${env:GCC_PATH}\\bin\\gcc.exe", + "includePath": [ + "${workspaceFolder}/**" + ], + "defines": [], + "cStandard": "c11", + "cppStandard": "c++17" + } + ], + "version": 4 +} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..c9b41ea --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,29 @@ +{ + // 使用 IntelliSense 了解相关属性。 + // 悬停以查看现有属性的描述。 + // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Build and Debug", + "type": "cppdbg", + "request": "launch", + "program": "${fileDirname}/${fileBasenameNoExtension}.exe", + "args": [], + "stopAtEntry": true, + "cwd": "${workspaceFolder}", + "environment": [], + "externalConsole": true, + "MIMode": "gdb", + "miDebuggerPath": "${env:GCC_PATH}/gdb.exe", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ], + "preLaunchTask": "Build" + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..1f3465c --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,26 @@ +{ + "files.associations": { + "*.tcc": "cpp", + "cctype": "cpp", + "clocale": "cpp", + "cstdint": "cpp", + "cstdio": "cpp", + "cstdlib": "cpp", + "cwchar": "cpp", + "cwctype": "cpp", + "exception": "cpp", + "initializer_list": "cpp", + "iosfwd": "cpp", + "iostream": "cpp", + "istream": "cpp", + "limits": "cpp", + "new": "cpp", + "ostream": "cpp", + "streambuf": "cpp", + "type_traits": "cpp", + "typeinfo": "cpp" + }, + "terminal.integrated.automationShell.windows": "cmd.exe", + "files.encoding": "gb18030", + "files.autoGuessEncoding": false +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..566ab93 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,52 @@ +{ + "tasks": [ + { + "type": "shell", + "label": "Build", + "command": "${env:GCC_PATH}/g++.exe", + "args": [ + "-g", + "${file}", + "-o", + "${fileDirname}/${fileBasenameNoExtension}.exe" + ], + "options": { + "cwd": "${env:GCC_PATH}" + }, + "problemMatcher": { + "owner": "cpp", + "fileLocation": [ + "relative", + "${workspaceRoot}" + ], + //"fileLocation": "absolute", + "pattern": { + "regexp": "^(.*):(\\d+):(\\d+):\\s+(error):\\s+(.*)$", + "file": 1, + "line": 2, + "column": 3, + "severity": 4, + "message": 5 + } + }, + "group": { + "kind": "build", + "isDefault": true + } + }, + { + "label": "Build & run C++ project", + "type": "shell", + "group": { + "kind": "test", + "isDefault": true + }, + "command": "${workspaceRoot}/run.bat", + "args": [ + "${fileDirname}/${fileBasenameNoExtension}.exe" + ], + "dependsOn":["Build"] + } + ], + "version": "2.0.0" +} \ No newline at end of file diff --git a/Template/Readme.md b/Template/Readme.md new file mode 100644 index 0000000..b4f8d75 --- /dev/null +++ b/Template/Readme.md @@ -0,0 +1,3 @@ +# + +* \ No newline at end of file diff --git a/Template/doc/Readme.md b/Template/doc/Readme.md new file mode 100644 index 0000000..b4f8d75 --- /dev/null +++ b/Template/doc/Readme.md @@ -0,0 +1,3 @@ +# + +* \ No newline at end of file diff --git a/Template/main.cpp b/Template/main.cpp new file mode 100644 index 0000000..f39ad54 --- /dev/null +++ b/Template/main.cpp @@ -0,0 +1,6 @@ +#include + +int main() +{ + std::cout << "Hello Easy C++ project!" << std::endl; +} diff --git a/Template/main.exe b/Template/main.exe new file mode 100644 index 0000000..d17ac32 Binary files /dev/null and b/Template/main.exe differ diff --git a/Template/test/in.txt b/Template/test/in.txt new file mode 100644 index 0000000..e69de29 diff --git a/run.bat b/run.bat new file mode 100644 index 0000000..4e86f2e --- /dev/null +++ b/run.bat @@ -0,0 +1,51 @@ +@echo off +set t1=%time% +REM call:time_start +REM call:time_diff +call:Process %1 +goto end + +:Process +for %%a in ("%1") do ( + set file_path=%%~dpa +) +echo %file_path% + +cd . > %file_path%test\out.txt +for %%i in ( %file_path%test\in*.txt) do ( + echo ## %%i >> %file_path%test\out.txt + echo %date% %time% >> %file_path%test\out.txt + call:time_start + %1 < %%i >> %file_path%test\out.txt + call:time_diff >> %file_path%test\out.txt +) + +goto:eof + +:time_start +set t1=%time% +goto:eof + +:time_diff +set t2=%time% + +set /a ms=1%t1:~9%*10 %% 1000 +set /a sec=1%t1:~6,2% %% 100 +set /a min=1%t1:~3,2% %% 100 +set /a hour=%t1:~0,-9% +set /a time1 = %hour% * 3600000 + %min% * 60000 + %sec% * 1000 + %ms% + +set /a ms=1%t2:~9%*10 %% 1000 +set /a sec=1%t2:~6,2% %% 100 +set /a min=1%t2:~3,2% %% 100 +set /a hour=%t2:~0,-9% +set /a time2 = %hour% * 3600000 + %min% * 60000 + %sec% * 1000 + %ms% +set /a time_dif = %time2% - %time1% + +echo; +echo ----------------------------------------------- +echo Process exited after %time_dif% ms with return value %ErrorLevel% +goto:eof + +:end +REM pause