super莫 发表于 2020-3-19 14:22:12

0、10
1、10
2、a、b、c
3、14、9、5
4、if(size>12)
{
cost = cost*1.05;
flag = 2;
}
else{bill = cost *flag;}
5、if(ibex >14)
{sheds = 3;
}
esle{sheds = 2;
help = 2*sheds
}
6、scanf("%d",&score);
if(score<0)
{printf("count =%d\n",count)}
else {count++;
scanf("%d",&score);
}
动动手
0、#include <stdio.h>

int main()
{
       float xiaojiayu=10000,danlixi,fuhelixi=10000;
           int i=0;

                for(i=1;i>0;i++)
                {
                      danlixi = xiaojiayu + (xiaojiayu * 0.1)*i;

                          fuhelixi = fuhelixi+(fuhelixi * 0.05);

                          if(danlixi<fuhelixi)
                          {
                             break;

                          }
                }
                printf("%d年后,黑夜的投资额超过小甲鱼!\n",i);
                printf("小甲鱼的投资额是:%.2f\n",danlixi);
                printf("黑夜的投资额是:%.2f\n",fuhelixi);

      return 0;
}

1、#include <stdio.h>

int main()
{
       float zichang=400,zongzichang;
                int i;

           for(i=1;i>0;i++)
           {
                   zichang = zichang-50;
              zichang = zichang+(zichang * 0.08);

                  if(zichang <= 0)
                  {
                     break;
                  }
           }
                printf("%d年之后,小甲鱼败光了所有的家产,再次回到一贫如洗.....\n",i);


      return 0;
}

依样画葫芦 发表于 2020-3-19 14:26:10

{:10_277:}

沙皮的表哥 发表于 2020-3-19 17:53:17

1

cddyy2366 发表于 2020-3-19 20:17:02

1

勤奋的tuzi 发表于 2020-3-20 00:57:15

1

zyh6452798 发表于 2020-3-20 13:14:41


da

Platycodon 发表于 2020-3-20 14:38:29

答案

Wizardgc 发表于 2020-3-20 19:18:06

1

panda1786291 发表于 2020-3-20 22:02:40

s

郑少波 发表于 2020-3-20 22:13:19

0.10个
1.11个
2.a
3.4 5 9
4.z= i<0? -i:i;
5.A.
bill=size>12?1.05*cost*2:cost*flag;

B.
sheds=ibex>14?3:2;
help=2*sheds;

C.
for(scanf("%d",&score);score>=0;scanf("%d",&score))
        count++;
printf("count=%d\n",count);

0.
#include<stdio.h>

int main()
{
        float xjy=10000,hy=10000;
        int year;

        for(year=1;xjy>=hy;year++)
        {
                xjy=10000+10000*0.1*year;
                hy+=hy*0.05;
        }

        printf("%d年后,黑夜的投资额超过小甲鱼!\n"
        "小甲鱼的投资额是:%.2f\n"
        "黑夜的投资额是:%.2f\n",year-1,xjy,hy);
        return 0;
}
1.
#include<stdio.h>

int main()
{
        int year;
        float money=4000000;

        for(year=1;money>0;year++)
        {
                money-=500000;
                money+=0.08*money;
        }

        printf("%d年之后,小甲鱼败光了所有的家产,再次回到一贫如洗......\n",year-1);
        return 0;
}
2.
#include<stdio.h>
#include<math.h>

int main()
{
        int i;
        float sum;
        for(i=1;fabs((double)1/(double)i)<pow((double)10,(double)-8);i=-(i+2))
        {
                sum=sum+(double)1/(double)i;
        }

        printf("Pi的近似值(保留7位小数)为:%.7f\n",4*sum);
        return 0;
}
3.
#include<stdio.h>

int main()
{
        int sum1=0,sum2=1,sum,month;
        for(month=1;month<=24;month++)
        {
                sum=sum1+sum2;
                sum1=sum2;
                sum2=sum;
        }
        printf("两年能繁殖%d只兔子!\n",sum);
        return 0;
}

七只嗷大喵 发表于 2020-3-21 18:07:29

{:10_264:}

joisonnuro 发表于 2020-3-21 18:49:38

0.10
1.11
2.abc
3.a=14 b=5 c=9
4.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.while(1)
{
        scanf("%d", &score);
        if (score < 0)
        {
                break;
        }
        count++;
}

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

zw8519807 发表于 2020-3-22 09:56:45

1

蓝天灬唯一 发表于 2020-3-22 11:34:21

鱼忘七秒 发表于 2020-3-22 16:27:53

看答案啦

芸开了 发表于 2020-3-22 19:09:53

数学好难

121786404 发表于 2020-3-22 19:18:20

nc_cwd 发表于 2020-3-22 23:26:01

{:5_109:}

青菜白玉 发表于 2020-3-23 09:10:53

666666666

乱码zzz 发表于 2020-3-23 09:21:21

0.100次
1.11个
2.c=5
b=c
a=b
a
3.5\5\4
4. x == |x| ? x:-x;
5.
if (size > 12)
{
      cost = cost * 1.05;
      flag = 2;;
}
else      bill = cost * flag;

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

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


页: 85 86 87 88 89 90 91 92 93 94 [95] 96 97 98 99 100 101 102 103 104
查看完整版本: S1E16:拾遗 | 课后测试题及答案