commit 9b502ee90c3eb2f328bf2a011b4afd2a38d0272c Author: Bluemangoo Date: Tue Feb 25 17:08:55 2025 +0800 Init diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..e1f1075 --- /dev/null +++ b/.clang-format @@ -0,0 +1 @@ +IndentWidth: 4 \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..adb36c8 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.exe \ 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..d21cdd3 --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,21 @@ +{ + "configurations": [ + { + "name": "Win32", + "includePath": [ + "${workspaceFolder}/**", + "C:/mingw-w64/include", + "C:/mingw-w64/x86_64-w64-mingw32/include" + ], + "defines": [], + "compilerPath": "gcc", + "intelliSenseMode": "clang-x64", + "cStandard": "c11", + "cppStandard": "c++17", + "browse": { + "limitSymbolsToIncludedHeaders": true + } + } + ], + "version": 4 +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..8caf13f --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "files.associations": { + ".env": "env", + "ostream": "cpp", + "iosfwd": "cpp" + } +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..a5592fa --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,28 @@ +{ + "tasks": [ + { + "type": "cppbuild", + "label": "C/C++: gcc 生成活动文件", + "command": "gcc", + "args": [ + "-fdiagnostics-color=always", + "-g", + "${file}", + "-o", + "${fileDirname}/${fileBasenameNoExtension}.exe" + ], + "options": { + "cwd": "${fileDirname}" + }, + "problemMatcher": [ + "$gcc" + ], + "group": { + "kind": "build", + "isDefault": true + }, + "detail": "调试器生成的任务。" + } + ], + "version": "2.0.0" +} \ No newline at end of file diff --git a/0225/1.c b/0225/1.c new file mode 100644 index 0000000..659b5e9 --- /dev/null +++ b/0225/1.c @@ -0,0 +1,9 @@ +#include +#define PI 3.14159265358979323846 + +int main() { + double r; + scanf("%lf", &r); + printf("%f\n%f", 4 * PI * r * r, PI * r * r * r * 4 / 3); + return 0; +} \ No newline at end of file diff --git a/0225/2.c b/0225/2.c new file mode 100644 index 0000000..fe27f1a --- /dev/null +++ b/0225/2.c @@ -0,0 +1,9 @@ +#include +#include +#define square(x) ((x) * (x)) + +int main() { + int x1, y1, x2, y2; + scanf("%d %d %d %d", &x1, &y1, &x2, &y2); + printf("%f", sqrt(square(x2 - x1) + square(y2 - y1))); +} \ No newline at end of file diff --git a/0225/3.c b/0225/3.c new file mode 100644 index 0000000..f072963 --- /dev/null +++ b/0225/3.c @@ -0,0 +1,8 @@ +#include + +int main() { + int num; + scanf("%d", &num); + printf("%d %d %d\n", num / 100, num / 10 % 10, num % 10); + return 0; +} \ No newline at end of file diff --git a/0225/4.c b/0225/4.c new file mode 100644 index 0000000..9ec30e6 --- /dev/null +++ b/0225/4.c @@ -0,0 +1,11 @@ +#include + +int main() { + char a, b; + scanf("%c %c", &a, &b); + char c = a; + a = b; + b = c; + printf("%c %c", a, b); + return 0; +} \ No newline at end of file diff --git a/0225/5.c b/0225/5.c new file mode 100644 index 0000000..7aa39f5 --- /dev/null +++ b/0225/5.c @@ -0,0 +1,6 @@ +#include +int main(){ + char c; + scanf("%c", &c); + printf("%c %c\n%d %d %d", c, c + 1, c - 1, c, c + 1); +} \ No newline at end of file diff --git a/0225/txt b/0225/txt new file mode 100644 index 0000000..af435e5 --- /dev/null +++ b/0225/txt @@ -0,0 +1 @@ +p32-33 \ No newline at end of file