leoysl 发表于 2023-2-14 13:37:04

看看答案

fuaowei 发表于 2023-2-14 15:27:44

{:10_266:}

SAiKETSU 发表于 2023-2-14 16:29:59

{:5_109:}

别吃我饼干 发表于 2023-2-15 15:48:58

KB9forever 发表于 2023-2-16 11:14:12

1

鱼c123456 发表于 2023-2-16 15:58:30

#include <stdio.h>
#include <math.h>

int main()
{
      long double pi, temp, k;
      int i;

      i = 1;
      k = 1;

      while (1)
      {
                temp = 4 * (i * 1 / k);

                if (fabs(temp) < pow(10, -8))
                {
                        printf("%.7Lf\n", pi);
                        break;
                }
                else
                {
                        pi += temp;
                }

                i = -i;
                k += 2;
      }

      return 0;
}

a2272497309 发表于 2023-2-16 19:26:38

666666666

千尋与 发表于 2023-2-21 10:46:24

0.10
1.0
2.a, b, c
3.
a = 14
    b = 5
      c = 9
            4.x >= 0 ? x : -x
            5.
            A

if (size > 12) {
        cost *= 1.05;
        flag = 2;

} else {
        bill *= flag;
}

B

if (ibex > 14) {
        sheds = 3;
}

sheds = 2;
help = 2 * sheds;
C
scanf("%d", &score);

if (score < 0) {
        printf("count = %d\n", count);

} else {
        count++;
        scanf("%d", &score);
        printf("count = %d\n", count);
}

0.
#include <stdio.h>
#include <math.h>

int main() {
        double xjy, xjyb, hyb, hy;
        hy = xjy = 0;
        xjyb = hyb = 10000;
        int year = 0;

        while (xjy >= hy) {
                xjy = xjyb + (xjyb * 0.1) * (year + 1);
                hy =hyb * pow(1 + 0.05, year + 1);
                year++;
        }

        printf("%d年后,黑夜的投资额超过小甲鱼!\n\
小甲鱼的投资额是:%.2lf\n\
黑夜的投资额是:%.2lf", year, xjy, hy);

        return 0;
}
1.
#include <stdio.h>

int main() {
        double sum;
        sum= 4000000;
        int year;
        year = 0;

        while (sum >= 0) {
                sum = sum + 4000000 * 0.08 * (year + 1) - 500000 * (year + 1);
                year++;
        }

        printf("%d年之后,小甲鱼败光了所有的家产,再次回到一贫如洗……", year);
        return 0;
}
2.
#include <stdio.h>
#include <math.h>

int main() {
        double sum;
        sum = 0;
        double i, x;
        i = x = 1;

        while (fabs(i / x) >= pow(10, -8)) {
                sum += i / x;
                i = -i;
                x += 2;
        }

        printf("%.7lf", sum * 4 );

        return 0;
}
3.

#include <stdio.h>

int main() {
        long long x, month;
        x = 2;

        for (month = 1; month <= 24; month++) {

                x += 2;
        }

        printf("两年之后可以繁殖%lld对兔子", x / 2);

        return 0;
}

zxc++ 发表于 2023-2-21 14:31:39

1

mergchanst 发表于 2023-2-21 16:50:01

111

fogpost 发表于 2023-2-22 09:18:55

回复

元贝老师 发表于 2023-2-22 18:24:37

1

plain6 发表于 2023-2-22 21:00:05

对答案

Sherlock_Y 发表于 2023-2-23 22:42:28

1

C0401040214 发表于 2023-2-25 11:49:39

{:9_241:}

kangkang24 发表于 2023-2-26 19:28:23

.

strong3_3 发表于 2023-2-27 14:45:49

看看

YHJxiao 发表于 2023-2-27 19:18:48

i love fishC

小酥吃口酥 发表于 2023-2-27 23:49:13

1

小酥吃口酥 发表于 2023-2-27 23:49:53

1
页: 244 245 246 247 248 249 250 251 252 253 [254] 255 256 257 258 259 260 261 262 263
查看完整版本: S1E16:拾遗 | 课后测试题及答案