534492 发表于 2022-3-3 15:36:45

1

太郎 发表于 2022-3-3 19:12:38

1

取名小废材 发表于 2022-3-3 20:35:31

0、100个
1、11个
2、a、b、c
3、a=14; 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;
}
sheds = 2;
help = 2 * sheds;

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

0、
#include<stdio.h>
#include<math.h>
int main()
{
        float total1=10000.00;
        float total2=10000.00;
        int year;
        float r1=0.1,r2=0.05;
        float r=total1*r1;
        for(year=0;total1>=total2;year++)
        {
                total1=total1+r;
                total2=total2+total2*r2;
        }
        printf("%d年后,黑鱼的投资额超过小甲鱼!\n",year);
        printf("小甲鱼的投资额是:%.2f\n",total1);
        printf("黑鱼的投资额是:%.2f\n",total2);
       
        return 0;
}

1、#include<stdio.h>
int main()
{
        long long sum=4000000,i=500000;
        int year;
        for(year=0;sum>0;year++)
        {
                sum=(sum-i)*(1+0.08);
        }
        printf("%d年后,小甲鱼败光了所有的家产,再次回到一贫如洗……",year);
        return 0;
}

2、
#include<stdio.h>
#include<math.h>
int main()
{
        float Pi,p=1,i=1,j=1,sum=0;
        while(p>=0.00000001)
        {
                p=1/j;
                sum=sum+i*p;
                i=-i;
                j+=2;
        }
        Pi=sum*4;
        printf("Pi=%.7f",Pi);
        return 0;
}

3、#include<stdio.h>
int main()
{
        int month;
        long long count=1,temp;
        for(month=2;month<=24;month++)
        {
                temp=count;
                count=count+temp;
        }
        printf("两年之后可以繁殖%lld对兔子。\n",count);
        return 0;
}

up七六 发表于 2022-3-3 21:23:39

1

1599299119 发表于 2022-3-4 10:51:54

1

H2012 发表于 2022-3-4 16:40:50

11

xiaomumuzi 发表于 2022-3-4 19:42:33

g

灰灰永远的神 发表于 2022-3-4 23:24:30

{:5_104:}

晓季仙人 发表于 2022-3-5 10:40:42

1

forevergouxiao 发表于 2022-3-5 11:07:37

朕想知道

1539303406 发表于 2022-3-5 16:29:38

看看

机械小白爱学c 发表于 2022-3-5 16:35:01

111

zhangkuang 发表于 2022-3-5 17:17:14

0.10
1.无数个
2.a
3.a=14b=5 c=9
4.printf("x")
scanf("%d",&x)

if(x<0)
{
x=-x;
}
z=x;
5.
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);

phr826 发表于 2022-3-6 09:13:00

v

穆远c 发表于 2022-3-6 09:33:18

lcdjl 发表于 2022-3-6 09:37:52

q

吹野与梦 发表于 2022-3-6 15:24:18

66666

不知君 发表于 2022-3-6 22:15:36

回复

Gx900D 发表于 2022-3-7 17:30:38

988888

逆光飞翔芜湖 发表于 2022-3-7 18:31:40

真不错
页: 208 209 210 211 212 213 214 215 216 217 [218] 219 220 221 222 223 224 225 226 227
查看完整版本: S1E16:拾遗 | 课后测试题及答案