tucc 发表于 2021-12-7 00:02:52


嘿,亲爱的鱼油,每天都要过得开心哦^_

rootcatcher 发表于 2021-12-7 01:26:45

学习打卡

905991271 发表于 2021-12-7 17:12:39

10A
不会打印b
14 5 9
if (size > 12)
{
      cost = cost * 1.05;
}
bill = cost * flag;
if (ibex > 14)
{
      sheds = 3;
}
else
sheds = 2;
help = 2 * sheds;
readin: scanf("%d", &score);
if (score < 0)
{
      printf("count = %d\n", count);
}
else
count++;
#include <stdio.h>
int main(){
      float a =10000, b =10000;
      int y=0;
      while(!(a<b))
      {
      a=a+ 1000;
      b=b+b*0.05;
      y+=1;
      }
      printf("%d年后将超过\n",y);
      printf("a的投资额是%.2f\n",a);
      printf("b的投资额是%.2f\n",b);


      return 0;

int main()
      {
      int a=4000000,b=500000,y=0;
      while (a>0)
      {
      a = a -b;
      a = a*1.08;
      y =y+1;
      }
      printf("%d将花完",y);
      return 0;

      }
#include <math.h>
#include <stdio.h>
int main()
      {
      double pi,sum=0,i=1;
      int count =1;
      while(fabs(i)<1000000000)
      {
      if(count%2==1){
      i +=2;
      i = -i;
      count+=1;
      sum=sum+(1/i);}
      else{
      i=fabs(i)+2;
         count+=1;
      sum=sum+(1/i);
      }
      }
      pi =(1+sum)*4;
      printf("pi=%.7f\n",pi);
      return 0;
      }

herqu 发表于 2021-12-7 20:05:55

111

斩首的夜 发表于 2021-12-7 20:10:43

1

棠梨沪酒 发表于 2021-12-7 21:34:01

111

Shiefu 发表于 2021-12-7 23:19:59

#include <stdio.h>
#include <stdbool.h>
#include <math.h>
#pragma warning(disable:4996)//使用scanf语句

int main()
{
        float i=10000, j=10000,y=0;
        int x;
        for (x = 0; j <= i; x++)
        {
                y = 0.1 * 10000;
                i = y + i;
                j = 0.05*j + j;
        }
        printf("%d年后黑夜投资额超过小甲鱼\n", x);
        printf("小甲鱼的投资额为%.2f\n",i);
        printf("黑夜的投资额为%.2f\n", j);
        return 0;
}

#include <stdio.h>
#include <stdbool.h>
#include <math.h>
#pragma warning(disable:4996)//使用scanf语句

int main()
{
        int x = 4000000,y;
        for (y = 0; x > 0; y++)
        {
                x = x - 500000;
                x = x * 0.08 + x;
        }
        printf("%d",y);
        return 0;

}

#include <stdio.h>
#include <stdbool.h>
#include <math.h>
#pragma warning(disable:4996)//使用scanf语句

int main()
{
        int i, j=0, k=1;
        for (i = 0; fabs(1/k) < 10 ^ (-8); i++)
        {
                k = fabs(k) + 2;
                if (i % 2 == 0)
                {
                        k = -k;
                }
                j = 1 + (1 / k);
        }
        printf("%d",j);
        return 0;
}

努力的大肥兔 发表于 2021-12-8 18:59:26

参考答案

kyyyyy 发表于 2021-12-8 19:18:21

加油

玥禾 发表于 2021-12-9 11:00:52

.

前来学习一下 发表于 2021-12-9 15:04:27

0.0

SeeNoEvil 发表于 2021-12-9 17:14:50

本帖最后由 SeeNoEvil 于 2021-12-9 17:21 编辑

0. 10个
1. 0个
2. a b c
3. a = 14;b = 5;c = 9
4. z = x >= 0 ?x : -x
5. if (size > 12)
{
      cost = cost * 1.05;
      flag = 2;
}
bill = cost * flag;

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

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

LSliu603 发表于 2021-12-9 19:18:57

{:5_108:}

西梓熙 发表于 2021-12-10 15:19:21


100
10

a=33 b=4 c=10

if (size > 12)
{
      cost = cost * 1.05;
}
else
bill = cost * flag;






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


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

}

章浮萍 发表于 2021-12-11 21:14:29

嘿,亲爱的鱼油,每天都要过得开心哦^_^

1148431841 发表于 2021-12-11 21:48:19

.

天○●衍 发表于 2021-12-12 15:51:57

答案

注册名字可真难 发表于 2021-12-12 21:09:34

芜湖

sdret_zyb 发表于 2021-12-12 21:33:45

huifu

xieyuwen 发表于 2021-12-13 15:37:21

1
页: 195 196 197 198 199 200 201 202 203 204 [205] 206 207 208 209 210 211 212 213 214
查看完整版本: S1E16:拾遗 | 课后测试题及答案