哈哈1234 发表于 2021-11-28 22:08:13

答案

CccC! 发表于 2021-11-29 10:14:38

#include <stdio.h>
#include<math.h>
int main()
{
    double i=10000, j=10000;
    int y=1;
    while (y>0)
    {
      i = 10000 + 10000 * 0.1 * y;
      j = 10000 * pow((1 + 0.05), y);
      if (j > i)
      {
            break;
      }
      y++;

    }
    printf("%d年后资产超越\n", y);
    printf("投资额为:%.2f\n", i);
    printf("投资额为:%.2f\n", j);
    return 0;

}

#include <stdio.h>
#include<math.h>
int main()
{
    double i=4000000;
    int y=1;
    while (y>0)
    {
      i = i - 500000;
      i = i * (1 + 0.08);
      if (i<=0)
      {
            break;
      }
      y++;

    }
    printf("%d年后资产败光\n", y);
   
   
    return 0;

}

#include <stdio.h>
#include<math.h>
int main()
{
    int i, j, p;
    p = 2;
    scanf_s("%d", &i);
    i = i * 12;
    for (j = 1; j <= i; j++)
    {
      p = p + 2 * (j - 1);
    }
    printf("%d\n", p);
    return 0;

}

crispTT 发表于 2021-11-29 20:20:15

已完成

phlaoi 发表于 2021-11-29 22:08:15

1

风亦 发表于 2021-11-30 23:12:14

1010
a b c
b = 3,c = 8, a = (3,4,8,14)

小明要人带 发表于 2021-12-1 09:19:30

1

Donja 发表于 2021-12-1 19:30:34

查看参考答案

jack_straw_man 发表于 2021-12-1 21:28:53

0. 10
1. 0如果++i 就是 10个
2. a, b, c
3. a= 14; b = 5; c = 9;
4. z = a>0?a:-a;
5.
A.
if (size > 12)
{
       cost = cost * 1.05;
      flag = 2;
}
bill = cost * flag;

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

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

l14564 发表于 2021-12-2 01:31:10

0.110
1.i++ 相当于会先用i=0进行赋值再给i加1?(a++) 是先将变量 a 的值(5)做为整个表达式的值返回,再将 a 自增 1(类似于 a = a + 1)?i++先返回数值再进行自增?++i先进行自增再返回数值
2.a bc?
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;
}
sheds = 2;
help = 2 * sheds;

C.

do
{
scanf("%d", &score);
}
while (count++,score > 0);
printf("count = %d\n", count);

Churling 发表于 2021-12-2 10:55:36

3




sznar 发表于 2021-12-2 20:03:31

1

很酷1212 发表于 2021-12-2 20:25:30

1

鱼鱼鱼小 发表于 2021-12-3 10:33:04

000

yong_ze_ 发表于 2021-12-3 13:24:30

答案

张文耀860 发表于 2021-12-3 16:21:04

联想知道

Rachel·梨 发表于 2021-12-4 11:11:11

{:10_257:}

学c的小同鞋 发表于 2021-12-4 11:32:17

完成

zzl-jy 发表于 2021-12-4 22:04:03

{:5_90:}

salv 发表于 2021-12-5 10:32:43

{:5_97:}

kg120 发表于 2021-12-5 11:39:03

最后一题也可以拓展为分别计算小、中、老兔子的数量
页: 194 195 196 197 198 199 200 201 202 203 [204] 205 206 207 208 209 210 211 212 213
查看完整版本: S1E16:拾遗 | 课后测试题及答案