Roiter 发表于 2019-2-3 19:06:03

0 100次
1 9次
2 a b c
3 a=14 b=4 c=10
4 z = x > 0 ? x : (-x)
5
A
if(size > 12)
{
        cost *= 1.05;
}
bill = cose * 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);
        }
        count++;
}

sorrowblue 发表于 2019-2-4 23:57:52

回复一个看一看

sophie2018 发表于 2019-2-9 10:59:52

{:5_90:}

花椒壹拾伍 发表于 2019-2-9 23:29:48

本帖最后由 花椒壹拾伍 于 2019-2-10 14:21 编辑

:0:10个A。

1:0个。

2:abc

3:b=3
c=3+5=8,b=4
a=8+4=13,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:
scanf("%d", &score);
while (score >= 0)
{
      count++;
      scanf("%d", &score);
}
printf("count = %d\n", count);


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

int main()
{
        float a,b;
        int year;
       
        year = 1;
        a = 10000 + 1000* year;
        b = 10000 * pow(1.05 , year);
       
       
        while ( a > b)
        {
                year = year +1;
                a = 10000 + 1000* year;
          b = 10000 * pow(1.05 , year);
        }
       
        printf("%d年后,黑夜的投资额超过了小甲鱼!\n",year);
        printf("小甲鱼的投资额是:%.2f\n",a);
        printf("黑夜的投资额是:%.2f",b);
       
        return 0;
}

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

int main()
{
        float total , year;
       
        total = 4000000;
        year = 0;
       
        while( total >= 0)
        {
                total = total - 500000;
                total = total * 1.08;
                year = year + 1;
        }
       
        printf("%.f年后,小甲鱼败光了所有的家产,再次回到一贫如洗......\n",year);
       
        return 0;
}

动动手2:
#include <stdio.h>
#include <math.h>

int main()
{
        int sign = 1;//正负符号
        double pi , fm , dq;//fm为分母,dq为当前项的值
       
        pi = 0 ; fm = 1; dq = 1;
       
        while ( fabs(dq) >= pow(10,-8) )
        {
                pi = pi + dq ;
                fm = fm + 2;
                sign = -sign;
                dq = sign / fm;
       }
       
       pi = pi * 4 ;
       
       printf("%.7f",pi);
       
       return 0;
}

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

int main()
{
      long a = 1, b = 1, c, i;

      for (i = 3; i <= 24; i++)
      {
                c = a + b;
                a = b;
                b = c;
      }

      printf("两年后,总共有%ld只兔子!\n", c);

      return 0;
}

Razr丶锋芒 发表于 2019-2-10 09:01:46

123

九少 发表于 2019-2-10 14:22:47

1

cc84525145 发表于 2019-2-11 21:57:43

杀杀杀

Wangzy1025 发表于 2019-2-12 09:50:22

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

int main() {
       
        double sum = 0, i;
        for (i = 1; 1 / (2 * i - 1) > pow(10, -8); i++) {
                if ((long)i % 2) {
                        sum += 1 / (2 * i - 1);
                } else {
                        sum += 1 / (1 - 2 * i);
                }
        }
        printf("圆周率的七位小数为%.7f\n", sum * 4);
       
        return 0;
}

梦开始的地方01 发表于 2019-2-12 11:26:53

-1

2316829671 发表于 2019-2-12 20:35:42

{:5_109:}

稚心语 发表于 2019-2-15 11:07:09

加油!

未来的中国首富 发表于 2019-2-16 15:31:53

0.100
1.10
2.a
3.c=10b=6a=16
4.z=x*x/x
5.if(size > 12)
   {
            cost=cost*1.05;
   }
      else
       {

}

不存在的人 发表于 2019-2-16 17:05:28

缓慢跟上

njnf66 发表于 2019-2-16 17:27:44

喵喵喵

FrostMoon 发表于 2019-2-16 17:42:37

支持

蔡周杰 发表于 2019-2-16 21:58:26

而黯然

复方谷氨酰胺 发表于 2019-2-17 08:54:28

mark

清风逐梦丶 发表于 2019-2-19 14:46:35

加油

skygy92 发表于 2019-2-19 15:39:24

000

十七言 发表于 2019-2-19 19:17:01

看看
页: 29 30 31 32 33 34 35 36 37 38 [39] 40 41 42 43 44 45 46 47 48
查看完整版本: S1E16:拾遗 | 课后测试题及答案