鱼C论坛

 找回密码
 立即注册
楼主: 小甲鱼

[课后作业] S1E16:拾遗 | 课后测试题及答案

  [复制链接]
发表于 2020-3-19 20:17:02 | 显示全部楼层
1
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2020-3-20 00:57:15 | 显示全部楼层
1
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2020-3-20 13:14:41 | 显示全部楼层

da
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2020-3-20 14:38:29 | 显示全部楼层
答案
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2020-3-20 19:18:06 | 显示全部楼层
1
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2020-3-20 22:02:40 | 显示全部楼层
s
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 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;
}
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2020-3-21 18:07:29 | 显示全部楼层
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 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);
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2020-3-22 09:56:45 | 显示全部楼层
1
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

头像被屏蔽
发表于 2020-3-22 11:34:21 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2020-3-22 16:27:53 | 显示全部楼层
看答案啦
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2020-3-22 19:09:53 | 显示全部楼层
数学好难
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

头像被屏蔽
发表于 2020-3-22 19:18:20 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2020-3-22 23:26:01 | 显示全部楼层
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2020-3-23 09:10:53 | 显示全部楼层
666666666
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 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);
}


小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2020-3-23 10:18:14 | 显示全部楼层
  1. #include <stdio.h>

  2. int main()
  3. {
  4.         long a = 1, b = 1, c, i;

  5.         for (i = 3; i <= 24; i++)
  6.         {
  7.                 c = a + b;
  8.                 a = b;
  9.                 b = c;
  10.         }

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

  12.         return 0;
  13. }
复制代码
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2020-3-23 11:04:21 | 显示全部楼层
  1. #include<stdio.h>
  2. #include<math.h>
  3. int main(void)
  4. {
  5.         int sign = 1; ;
  6.         double i = 0.0,n=1,temp = 1.0;
  7.         while(fabs(temp) >=1e-8)
  8.         {
  9.                 i +=temp ;
  10.                 n += 2;
  11.                 sign = -sign;
  12.                 temp = sign/n;
  13.                
  14.         }
  15.         printf("pi = %10.7f",4*i);       
  16.         return 0;
  17. }
复制代码
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2020-3-23 12:06:29 | 显示全部楼层
A
if (size > 12)
{
        cost = cost * 1.05;
}
bill = cost * flag;
        flag = 2;
B
if (ibex > 14)
{
       sheds = 3;
}
sheds = 2;
help = 2 * sheds;
C.

if (score < 0)
{
     printf("count = %d\n", count);
}
count++;
scanf("%d", &score);
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-4-22 20:25

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表