chenkai1997 发表于 2019-7-3 10:40:47

0.10个
1.10个
2.a
3.b = 5 c=4 a=9
4.x > 0?z = x:z = -x;
5.A.int size = 0,i = 1;
        if(size > 12)
        {
                i = 0;
        }
        if(i == 0)
        {
                cost = cost * 1.05;
                flag = 2;
        }
        if(i == 1)
        {
                bill = cost * flag;
        }
B.        int ibex = 0,i = 1,sheds;
        if(ibex > 14)
        {
                i = 0;
        }
        sheds = 2;
        if(i == 0)
        {
                sheds = 3
        }
        if(i == 1)
        {
                help = 2 * sheds;
        }




#include <stdio.h>

int main()
{       
        float i = 10000,j = 10000;
        int year;
        while(i >= j)
        {
                i = i + 10000*0.1;
                j = j + j*0.05;
                year++;
        }
        printf("%d年后,黑夜的投资额超过小甲鱼!\n",year);
        printf("小甲鱼的投资额是:%.2f\n",i);
        printf("黑夜的投资额是:%.2f",j);
}
#include <stdio.h>

int main()
{
        long long int coin = 4000000;
        int year = 0;
        while(coin >= 0)
        {
                coin = (coin -500000 );
                coin = coin + coin*0.08;
                year++;
        }
        printf("%d",year);
}

OliverQueen 发表于 2019-7-3 22:14:08

BenVenus 发表于 2019-7-5 20:26:59

666666666666666666

tanfan 发表于 2019-7-5 22:35:38

动手3我没读懂题{:10_265:}

Hades帅呆呆 发表于 2019-7-6 13:12:47

月无涯 发表于 2019-7-6 19:02:55

看看

我爱吃老虎 发表于 2019-7-8 00:23:40

I love FishC.com!

青青你好 发表于 2019-7-8 21:50:21

回复

zw1996922112 发表于 2019-7-9 12:25:29

AlanLu 发表于 2019-7-9 20:06:47

666

2012277033 发表于 2019-7-10 17:13:56

0、90个
1、10个
2、a,b,c
3、a=14,b=5,c=9
4、不懂
5、
A、if(size>12)
    {
                cost = cost*1.05;
      flag=2;
    }
    else
    {
                bill =cost * flag;
    }
B、sheds=2;
    if(ibex>14)
    {
                sheds=3;
    }
    else
    {
                help =2 * sheds;
    }
C、count++;
    if(score<0)
    {
                printf("count = %d\n",count);
    }
    else
    {
                scanf("%d",&score);
    }
动动手

崔予礼 发表于 2019-7-10 18:40:49

分数的搞不懂

挖煤的派大星 发表于 2019-7-11 10:25:08

I LOVE FISHC

我爱魔幻 发表于 2019-7-11 19:13:36

0.100个
1.11个
2.a,b,c
3.a = 14,b = 5,c = 9。

4.
if(x>=0)
{
   z = x;
}
else
{
z=-x;
}
5.
A.
if (size > 12)
{
      cost = cost * 1.05;
      flag = 2;
       
}
else
{
      bill = cost * flag;
}

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

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

动动手
0.
#include<stdio.h>

int main()
{
        float a, b, i, j;
        int year = 0;
        a = 0.1;
        b = 0.05;
       
        for(i = 10000, j = 10000; i >= j; year++)
        {
                i = 10000 + 10000 * a * (year);
                j = 10000 * pow((1+b), year);
        }
       
        printf("%d年后,黑夜的投资额超过小甲鱼!\n", year-1);
        printf("小甲鱼的投资额是:%.2f\n", i);
        printf("黑夜的投资额是:%.2f\n", j);
       
        getchar ();
}


1.

#include<stdio.h>

int main()
{
        int count, year, i;
        float rate = 0.08;
        year = 0;
        i = 500000;
        for(count = 4000000; count >= 0; year++)
        {
                count = count - i;
               
                if(count >= 0)
                {
                        count = count * ( 1 + rate);
                }
        }
       
        printf("%d年之后,小甲鱼败光了所有的家产,再次回到一贫如洗……\n", year);
       
        getchar ();
}

dottyu 发表于 2019-7-12 17:31:40

0.100次
1.10个
2.a,b,c
3.a=14,b=3,c=9
4z=x>=0?x:abs(x)
5.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.readin: scanf("%d",&scors);
if (score < 0)
{
       printf("count = %d\n",count);
}
C.#include<stdio.h>

int main()
{
    int score,count=0;

    do
    {
      scanf("%d",&score);
      if(score<0)
      {
            break;
      }
      count++;
    }
    while(score>=0);
    printf("count = %d\n",count);
    return 0;
}
动动手.
0.#include<stdio.h>

int main()
{
    double a=10000,b=10000;
    int c=1;

    while(a>=b)
    {
      a=10000*(1+0.1*c);
      b=b*1.05;
      c++;
    }
    printf("%d年后,黑夜的投资额超过小甲鱼!\n",c-1);
    printf("小甲鱼的投资额是:%.2f\n",a);
    printf("黑夜的投资额是:%.2f\n",b);

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

int main()
{
    int a,b;
    a=3500000;
    b=1;

    while(a>0)
    {
      a=a*1.08-500000;
      b++;
    }
    printf("%d年之后,小甲鱼败光了所有的家产,再次回到一贫如洗……",b);
    return 0;

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

int main()
{
    double a=0,c;
    int b=1;

    do
    {
      a=a+1/b;
      if(b>0)
      {
            b=-(b+2);
      }
      else
      {
            b=fabs(b)+2;
      }
      c=fabs(1/b);
    }while(c>pow(10,-8));
    printf("%.7f\n",a);
}
3.
#include<stdio.h>

int main()
{
    int a,b,c,d;
    a=1,b=0,c=1;

    printf("年数:");
    scanf("%d",&d);

    while(c<d*12)
    {
      c++;
      a=a+b;
      b=a-b;
    }
    printf("经过%d年后有%d对兔子",d,a+b);

    return 0;

}

Beth 发表于 2019-7-13 12:54:15

hhh

qq273429856 发表于 2019-7-13 22:19:40

回复

joker__ 发表于 2019-7-14 16:47:25

。。。

DZcoolly 发表于 2019-7-14 22:25:59

1

Essex1 发表于 2019-7-14 23:47:55

0 100
1 无数个?
2 ?
3 ?
4 Z = x > 0 ? x; -x;
5
页: 41 42 43 44 45 46 47 48 49 50 [51] 52 53 54 55 56 57 58 59 60
查看完整版本: S1E16:拾遗 | 课后测试题及答案