KRYZE 发表于 2019-11-6 14:08:43

123

江老窝 发表于 2019-11-6 16:16:24

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

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

臣卜臣卜木曹 发表于 2019-11-6 18:07:36

测试题:
0            100
1            10
2            
3             13 3 8
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         readin: scanf("%d", &score);
if (score < 0)
{
      printf("count = %d\n", count);
}
count++;



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

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

      return 0;
}

1      #include <stdio.h>

int main()
{
      double money;
      int i;

      for (money = 400,i = 0;money >= 0;i ++)
      {
                money = (money - 50) * (1 + 0.08);
      }

      printf("%d年以后,小甲鱼败光了所有家产,再次回到了一贫如洗......\n",i);
      return 0;
}

2         #include <stdio.h>
#include <math.h>
int main()
{
      int flag = 1,i = 1;
      double pi,sum,num = 1,x;
      do
      {
                sum = sum + num;
                pi = 4 * sum;
                flag = -flag;
                i = i + 2;
                num = flag * num / i;
      } while ((x = fabs(num)) >= 10 ^ (-8));

      printf("圆周率的值是:%.7f\n",pi);

      return 0;


}


3                  

i陌路Oo 发表于 2019-11-6 20:16:29

完成

2508983730 发表于 2019-11-7 09:49:15


                        a += 3;

li040600 发表于 2019-11-7 15:56:36

开开心心掉发^.^

hjh18944743801 发表于 2019-11-7 16:13:55

654

LZiqag 发表于 2019-11-7 16:53:21

答案

chenyu940219 发表于 2019-11-8 09:08:27

看还会

chenyu940219 发表于 2019-11-8 09:09:04

C把丙苯

Crazyeye 发表于 2019-11-8 11:04:49

生兔子都懵逼了,一看答案,贼简单

Crazyeye 发表于 2019-11-8 12:51:31

@小甲鱼最后一题答案代码给错了
应该是这样的,a,b=2这样才对!等于1的话前几个月结果都不对
#include<stdio.h>
int main()
{
        long a=2,b=2,c,i;
        for(i=3;i<=24;i++)
        {
                c=a+b;
                a=b;
                b=c;
       }
       printf("二年后,总共有%ld!\n",c);
       
        return 0;
}

401080154 发表于 2019-11-8 20:45:18

查看答案

ctrlsss 发表于 2019-11-9 13:08:42

查看答案

Charon_wth 发表于 2019-11-9 17:32:06

zhichixiaojiayu

男势9290 发表于 2019-11-10 14:30:12

参考答案

18856966759 发表于 2019-11-11 16:47:56

100

y_x_usst 发表于 2019-11-11 20:20:50

朕想知道

15552518106 发表于 2019-11-11 21:44:30

答案答案

JYMine 发表于 2019-11-12 09:25:16

0
页: 58 59 60 61 62 63 64 65 66 67 [68] 69 70 71 72 73 74 75 76 77
查看完整版本: S1E16:拾遗 | 课后测试题及答案