diff --git a/【实践课外】1.顺序结构/7-1 是不是太胖了.c b/【实践课外】1.顺序结构/7-1 是不是太胖了.c new file mode 100644 index 0000000..0dc4990 --- /dev/null +++ b/【实践课外】1.顺序结构/7-1 是不是太胖了.c @@ -0,0 +1,11 @@ +#include + +int main() { + int h; + + scanf("%d", &h); + + printf("%.1lf\n", (double)(h - 100) * 0.9 * 2); + + return 0; +} diff --git a/【实践课外】1.顺序结构/7-1 是不是太胖了.jpg b/【实践课外】1.顺序结构/7-1 是不是太胖了.jpg new file mode 100644 index 0000000..83897fe Binary files /dev/null and b/【实践课外】1.顺序结构/7-1 是不是太胖了.jpg differ diff --git a/【实践课外】1.顺序结构/7-2 计算存款利息.c b/【实践课外】1.顺序结构/7-2 计算存款利息.c new file mode 100644 index 0000000..d65cb21 --- /dev/null +++ b/【实践课外】1.顺序结构/7-2 计算存款利息.c @@ -0,0 +1,14 @@ +#include +#include + +int main() { + double money, year, rate; + + scanf("%lf%lf%lf", &money, &year, &rate); + + double k = pow(rate + 1, year); + + printf("interest = %.2lf\n", money * k - money); + + return 0; +} diff --git a/【实践课外】1.顺序结构/7-2 计算存款利息.jpg b/【实践课外】1.顺序结构/7-2 计算存款利息.jpg new file mode 100644 index 0000000..64cebe3 Binary files /dev/null and b/【实践课外】1.顺序结构/7-2 计算存款利息.jpg differ diff --git a/【实践课外】1.顺序结构/7-3 整数算术运算.c b/【实践课外】1.顺序结构/7-3 整数算术运算.c new file mode 100644 index 0000000..231dcd6 --- /dev/null +++ b/【实践课外】1.顺序结构/7-3 整数算术运算.c @@ -0,0 +1,15 @@ +#include + +int main() { + int a, b; + + scanf("%d%d", &a, &b); + + printf("%d + %d = %d\n", a, b, a + b); + printf("%d - %d = %d\n", a, b, a - b); + printf("%d * %d = %d\n", a, b, a * b); + printf("%d / %d = %d\n", a, b, a / b); + printf("%d %% %d = %d\n", a, b, a % b); + + return 0; +} diff --git a/【实践课外】1.顺序结构/7-3 整数算术运算.jpg b/【实践课外】1.顺序结构/7-3 整数算术运算.jpg new file mode 100644 index 0000000..4ba5fb3 Binary files /dev/null and b/【实践课外】1.顺序结构/7-3 整数算术运算.jpg differ diff --git a/【实践课外】1.顺序结构/7-4 21-大鸟转转转实验室.c b/【实践课外】1.顺序结构/7-4 21-大鸟转转转实验室.c new file mode 100644 index 0000000..1178e6c --- /dev/null +++ b/【实践课外】1.顺序结构/7-4 21-大鸟转转转实验室.c @@ -0,0 +1,16 @@ +#include + +int main() { + int n; + + scanf("%d", &n); + + int a = n % 10; + int b = n / 10 % 10; + int c = n / 100 % 10; + int d = n / 1000; + + printf("%d\n", a * 1000 + b * 100 + c * 10 + d); + + return 0; +} diff --git a/【实践课外】1.顺序结构/7-4 21-大鸟转转转实验室.jpg b/【实践课外】1.顺序结构/7-4 21-大鸟转转转实验室.jpg new file mode 100644 index 0000000..5ab0932 Binary files /dev/null and b/【实践课外】1.顺序结构/7-4 21-大鸟转转转实验室.jpg differ diff --git a/【实践课外】1.顺序结构/7-5 石头剪刀布.c b/【实践课外】1.顺序结构/7-5 石头剪刀布.c new file mode 100644 index 0000000..7217e0c --- /dev/null +++ b/【实践课外】1.顺序结构/7-5 石头剪刀布.c @@ -0,0 +1,14 @@ +#include + +int n; +double p1, p2, p3, q1, q2, q3; + +int main() { + scanf("%d%lf%lf%lf%lf%lf%lf", &n, &p1, &p2, &p3, &q1, &q2, &q3); + + double win = p1 * q2 + p2 * q3 + p3 * q1; + + printf("%.4lf\n", win * n); + + return 0; +} diff --git a/【实践课外】1.顺序结构/7-5 石头剪刀布.png b/【实践课外】1.顺序结构/7-5 石头剪刀布.png new file mode 100644 index 0000000..98402f8 Binary files /dev/null and b/【实践课外】1.顺序结构/7-5 石头剪刀布.png differ