哗啦 发表于 2022-5-30 21:06:37

1

零的零次方 发表于 2022-5-30 22:25:50

{:10_265:}

2511153283 发表于 2022-5-31 13:13:43

先看答案

eeyycc 发表于 2022-5-31 15:28:48

{:5_109:}

w120400806 发表于 2022-6-1 09:51:35

看答案

唯爱路哥的无颜 发表于 2022-6-3 11:21:15

测试题:
0.100个
1.9个
2.a,b,c
3.a=3,b=4,c=10
4.x = 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:
If(score < 0)
{
printf(“count = %d\n”,count);
}
count++;
scanf(“%d”,&score);

动动手
0.
#include <stdio.h>
int main()
{
float sum = 10000,profit2=0,sum2=10000,total1,total2;
int n=1
;
while(total2 <= total1)
{
total1 = sum + sum * 0.1 * n;
profit2 = sum2 * 0.05;
total2 = sum2 +profit2;
sum2 += profit2;
n++;
}
printf("%d年后,黑夜的投资额超过小甲鱼!\n",n-1);
printf("小甲鱼的投资额是:%.2f\n",total1);
printf("黑夜的投资额是:%.2f\n",total2);
return 0;
}
1.
#include <stdio.h>
int main()
{
float money = 4000000,profit,cost = 500000;
int n=1;
while(money>0)
{
profit = money * 0.08;
money = money + profit - cost;
n++;
}
printf("%d年之后,小甲鱼败光了所有的家产,再次回到一贫如洗......\n",n);
return 0;
}

2.
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
int n;
float number,sum=1;
for(n=1;fabs(pow(-1,n+1)*(1/(2*(n+1)+1))) < pow(10,-8);n++)
{
number = pow(-1,n)*(1/(2*n+1));
sum += number;
}
printf("%.7f\n",sum);
return 0;
}

3.

Kieyuku-Acc 发表于 2022-6-3 11:53:27

支持

不改变的节奏 发表于 2022-6-4 13:38:13

回复

sgyth 发表于 2022-6-6 14:19:54

dsf

欢福勇乐 发表于 2022-6-7 17:07:20

已完成

quanru124 发表于 2022-6-12 21:37:12

.

觉哥无所畏惧 发表于 2022-6-13 11:45:19

。。。

doudou子最棒 发表于 2022-6-14 20:34:04

haobang

白小蔡 发表于 2022-6-14 21:07:02

{:5_90:}

阿玛尼 发表于 2022-6-15 17:41:49

1

jy00822484 发表于 2022-6-16 21:50:09

测试题:
0.无限个吧,因为j永远到不了10
1.10个
2.看了扩展阅读还是不懂你这题意思
3. a=14,b=5,c=9
4.
#include <stdio.h>

int main()
{
        int x;
        int z;
        printf("请输入一个数字:\n");
        scanf("%d", &x);
       
        if(x < 0)
        {
                z =(0 - x);
        }
        else
        {
                z = x;
        }
       
        printf("z的值是:%d\n", z);

        return 0;

}
5.
A.
if (size > 12)
{
         cost = cost * 1.05;
        flag = 2;
}
else
{
        bill = cost * flag;
}
B.
if (ibex > 14)
{
        goto b;
}
else
{
        sheds = 3;
        sheds = 2;
        help = 2 * sheds;
}
C.
do
{
scanf("%d", &score);
count++;
}
while (score >= 0)

printf("count = %d\n", count);
break;

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

int main()
{
        double jiayuM = 10000, heiyeM = 10000;
        int count = 0;
        do
        {
                jiayuM += 1000;
                heiyeM = heiyeM*1.05;
                count++;
        }while(jiayuM > heiyeM);
       
        printf("需要%d年后黑夜手头的Money才会超过小甲鱼\n", count);
        printf("小甲鱼的投资额是:%.2f\n", jiayuM);
        printf("黑夜的投资额是:%.2f\n", heiyeM);

        return 0;

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

int main()
{
        int count = 1;
        double jueduizhi = 0;
        double pai = 1;
        double fenzi = 1.0;
        double fenmu;
        do
        {
                fenmu = (1+2*(count - 1));
                jueduizhi =fabs(fenzi/fenmu);
                if(count % 2 != 0)
                {
                        pai = pai + jueduizhi;
                }
                else
                {
                        pai = pai - jueduizhi;
                }
                count++;
               
                printf("现在绝对值是:%.7f\n", jueduizhi);
                printf("现在Pi的值是:%.7f\n", pai);
        }
        while(jueduizhi > 0.00000001);
       
        printf("现在Pi的值是:%.7f\n", pai);
    return 0;
}//实在不行,换了几次方案,都没成功,拿个失败品来交吧。
2.做题目的时间远远大于看视频的时间

shuangye08 发表于 2022-6-20 18:58:17

0.10次
1.10次
2.a,b,c都是
3. a=14,b=4.c=8.
4.z=x>0?x:-x;
5.A:
if (size > 12)
{
       cost*=1.05
};
flag = 2;
bill = cost * flag;
B:
if (ibex > 14)
{
       sheds=2;
}
else {sheds = 2;};
help = 2 * sheds;
C:
while(count++)
{
scanf("%d",&score)
if(score<0){break;}
}
printf("count=%d",count)

laowu3 发表于 2022-6-20 20:30:37

拾遗 | 课后测试题及答案

ZERO。 发表于 2022-6-20 21:33:31

1

mike890208 发表于 2022-6-21 19:06:12

done
页: 219 220 221 222 223 224 225 226 227 228 [229] 230 231 232 233 234 235 236 237 238
查看完整版本: S1E16:拾遗 | 课后测试题及答案