This commit is contained in:
Bluemangoo 2025-02-25 17:08:55 +08:00
commit 9b502ee90c
Signed by: Bluemangoo
GPG Key ID: F2F7E46880A1C4CF
11 changed files with 102 additions and 0 deletions

1
.clang-format Normal file
View File

@ -0,0 +1 @@
IndentWidth: 4

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.exe

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

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

7
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,7 @@
{
"files.associations": {
".env": "env",
"ostream": "cpp",
"iosfwd": "cpp"
}
}

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

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

9
0225/1.c Normal file
View File

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

9
0225/2.c Normal file
View File

@ -0,0 +1,9 @@
#include <math.h>
#include <stdio.h>
#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)));
}

8
0225/3.c Normal file
View File

@ -0,0 +1,8 @@
#include <stdio.h>
int main() {
int num;
scanf("%d", &num);
printf("%d %d %d\n", num / 100, num / 10 % 10, num % 10);
return 0;
}

11
0225/4.c Normal file
View File

@ -0,0 +1,11 @@
#include <stdio.h>
int main() {
char a, b;
scanf("%c %c", &a, &b);
char c = a;
a = b;
b = c;
printf("%c %c", a, b);
return 0;
}

6
0225/5.c Normal file
View File

@ -0,0 +1,6 @@
#include <stdio.h>
int main(){
char c;
scanf("%c", &c);
printf("%c %c\n%d %d %d", c, c + 1, c - 1, c, c + 1);
}

1
0225/txt Normal file
View File

@ -0,0 +1 @@
p32-33