This commit is contained in:
2025-02-25 17:08:55 +08:00
commit 9b502ee90c
11 changed files with 102 additions and 0 deletions
+9
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
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
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
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
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
View File
@@ -0,0 +1 @@
p32-33