一般通过学习者 发表于 2021-8-8 19:55:58

学习

TobiichiMaster 发表于 2021-8-8 20:02:53

本帖最后由 TobiichiMaster 于 2021-8-8 20:06 编辑

10
0
abc
A
if(size>12)
{
cost=cost*1.05;
}
bill=cpst*flag;
B
if(ibex>14)
{
sheds=3;
}
else
sheds=2;
help=2*sheds;
C
do
{
scanf("%d", &score);
if (score < 0)
{
      printf("count=%d\n",count);
      break;
}
count++;
}
while(score>=0);

TobiichiMaster 发表于 2021-8-8 20:31:41

#include <stdio.h>
#include<stdlib.h>
#define money10000
int main()
{
    double yu=money, ye=money;
    int year;
    for (year = 0;ye <= yu;year++)
    {
      yu += money * 0.1 ;
      ye += ye * 0.05 ;
    }
    printf_s("黑夜在%d年后投资额超过小甲鱼\n", year);
    printf_s("小甲鱼的投资额%.2f\n", yu);
    printf_s("黑夜的投资额%.2f\n", ye);
    return 0;
}

妍妹妹 发表于 2021-8-8 23:07:39

1

MagicMate 发表于 2021-8-9 09:32:48

#include <stdio.h>

int main()
{
    int x,y;
    printf("请输入数值: ");
    scanf("%d",x);
    x >= 0 ? y=x : y=-x;
    printf("%d的绝对值是:",y);
    return 0;
}

三目不是这样吗,报错

TerenceL 发表于 2021-8-9 11:41:15

加油

avnetwang 发表于 2021-8-9 13:07:38

show me

番杰 发表于 2021-8-9 15:16:19

0.10
1.10
2.c=5
3. 14 5 9
4.x=>0? z=x,z=~x ;
5.A:

幻影yr 发表于 2021-8-9 15:17:54

本帖最后由 幻影yr 于 2021-8-9 16:42 编辑

0.10
1.10
2.abc
3.a=15, b=5, c=10
4.   x= x> 0?z=X:z= -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(flag=1)
{
        sacnf("%d", &score);
        if(score<0)
        {
                printf("count = %d\n", count);
                flag=0
        }
        else
        {
                count++;
                flag=1
        }
}



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

int main()
{
      float x, h;
      int year;


      for(year=1;x>=h;year++)
      {
                x=10000;
                h=10000;
                x= x + 1000 * year;
                h= h*pow(1.05,year);
      }

      year-=1;

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

      return 0;
}


1.#include<stdio.h>

int main()
{
      int capital=4000000, year;

      for(year=0;capital>0;year++)
      {
                capital-=500000;
                capital*=1.08;
      }


      printf("%d年之后,小甲鱼败光了所有的家产,再次回到一贫如洗...\n",year);

      return 0;
}

无公害最可爱 发表于 2021-8-9 16:07:42

NCA 发表于 2021-8-9 16:42:04

6

六本神仙 发表于 2021-8-9 16:57:59

做完了作业,看看答案哈

大马强 发表于 2021-8-9 19:08:15

{:10_277:}

18073526882 发表于 2021-8-9 20:25:23

11

三刀流.索隆 发表于 2021-8-10 10:49:26

本帖最后由 三刀流.索隆 于 2021-8-10 10:50 编辑

捡漏:
0.100次
1.12次
2.5
3.a == 1 , b == 3 , c == 4
4.if (x < 0)
            {x = x * (-1);z = x;}
         else
         {z = x;}
      

wxm23333 发表于 2021-8-10 10:57:59

666666666666666666666666

三刀流.索隆 发表于 2021-8-10 11:11:57

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
while (1)
{scanf("%d",&score);
if (score < 0)
{printf("count = %d\n",count);break;}
count++;}

159177shuai 发表于 2021-8-10 13:41:36

{:7_112:}

songshu.wert 发表于 2021-8-10 15:39:13

查看答案

icemexic 发表于 2021-8-10 18:09:44

1
页: 172 173 174 175 176 177 178 179 180 181 [182] 183 184 185 186 187 188 189 190 191
查看完整版本: S1E16:拾遗 | 课后测试题及答案