AdiosSpike 发表于 2021-10-20 20:15:45

今天也是努力的一天

白白叭叭叭叭 发表于 2021-10-21 12:27:18

0.
10个
1.
0个
2.
a, b, c
3.
a = 14; b = 5; c = 9;
4.
z = x >= 0 ? x : -x;

5.

A.
if (size > 12)
{
      cost = cost * 1.05;
      flag = 2;
}
bill = cost * flag;

B.

if (ibex > 14)
{
      sheds = 3;
}
else
{
      sheds = 2;
}
help = 2 * sheds;

C.

while (1)
        {
                scanf("%d", &score);
                if (score < 0)
                {
                  break;
                }
                count++;
        }
        printf("count = %d\n", count);


昵称加载错误 发表于 2021-10-21 12:35:38

0.
10个
1.
0个
2.
a, b, c
3.
a = 14; b = 5; c = 9;
4.
z = x >= 0 ? x : -x;

5.

A.
if (size > 12)
{
      cost = cost * 1.05;
      flag = 2;
}
bill = cost * flag;

B.

if (ibex > 14)
{
      sheds = 3;
}
else
{
      sheds = 2;
}
help = 2 * sheds;

C.

while (1)
        {
                scanf("%d", &score);
                if (score < 0)
                {
                  break;
                }
                count++;
        }
        printf("count = %d\n", count);



动动手
0.
#include <stdio.h>
#define PRINCIPAL 10000

int main()
{
        float principal1 = PRINCIPAL, principal2 = PRINCIPAL;
        int year;
       
        for (year = 0; principal1 >= principal2; year++)
        {
                principal1 += PRINCIPAL * 0.1;
                principal2 *= 1 + 0.05;
        }
       
        printf("%d年后 , 黑夜的投资额超过小甲鱼!\n小甲鱼的投资额是 : %.2f\n黑夜的投资额是 : %.2f\n", year, principal1, principal2);
       
        return 0;
}


1.
#include <stdio.h>

int main ()
{
        int year;
        float money = 400;
       
        for (year = 0; money > 0; year++)
        {
                money -= 50;
                money *= 1.08;
        }
       
        printf("%d年之后 , 小甲鱼败光了所有的家产 , 再次回到一贫如洗......\n", year);
       
        return 0;
}

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

int main()
{
        double sum = 0, num = 1.0;
       
        do
        {
                sum += num;
        }while (fabs(num = -1.0/(num < 0 ? 1.0/num - 2 : 1.0/num + 2)) >= pow(10, -8));

        printf("%.7f", 4 * sum);
       
        return 0;
}


3.
#include <stdio.h>

int main()
{
        int a = 1, b = 1, temp;
       
        for (int i = 2; i < 24; i++)
        {
                temp = b;
                b = a + b;
                a = temp;
        }
       
        printf("两年后可以繁殖%d次\n", b);
       
        return 0;
}

编程xiaohei 发表于 2021-10-21 21:41:31

s

Kingonline 发表于 2021-10-22 11:17:20

。。。

进击的小鱼苗 发表于 2021-10-22 15:10:29

1

陈哈哈666 发表于 2021-10-22 17:32:52

000

CZC1713 发表于 2021-10-22 20:03:41

0. 10个
1. 0 个
2.
3.a = 9, b = 3, c = 9
4.
A
if (size > 12)
{
        cost = cost * 1.05;
    flag = 2;;
}
else
{
        bill = cost * flag;
}

B
if (ibex > 14)
{
   sheds = 3;
}
else
{
        sheds = 2;
        help = 2 * sheds;
}

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


卿意裳 发表于 2021-10-22 20:56:27

.

duke975 发表于 2021-10-23 14:33:50

打卡

我叫星星 发表于 2021-10-23 21:15:03

333

金子轩牛逼 发表于 2021-10-23 21:31:44

0.81 1.10 2.a 3.a=30 b=3 c=9 4.?

smallhao 发表于 2021-10-24 04:58:49

看看答案

fbsgngtr 发表于 2021-10-24 15:55:44

1

Lacia 发表于 2021-10-24 23:00:09

查看参考答案

三尺神明 发表于 2021-10-25 08:31:54

Ahnosama 发表于 2021-10-25 20:29:25

dasd

sdasd

一百分 发表于 2021-10-26 17:15:14

u

270787139 发表于 2021-10-26 18:41:32

10

Enock 发表于 2021-10-26 20:46:41

打卡
页: 187 188 189 190 191 192 193 194 195 196 [197] 198 199 200 201 202 203 204 205 206
查看完整版本: S1E16:拾遗 | 课后测试题及答案