西城牧遥 发表于 2021-11-23 11:22:40

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

桑桑sunset 发表于 2021-11-23 17:23:34

{:9_241:}

akf48 发表于 2021-11-23 19:28:13

0.10个
1.10个
2.a、b、c
3.16、5、11

鱼秋996 发表于 2021-11-23 19:42:02

1

一休的木鱼 发表于 2021-11-23 20:36:31

{:5_98:}

其奈公何 发表于 2021-11-23 21:46:47

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

int main()
{
        long double least, result, x;
        int a, b, c, i;
       
        a = b = 1;
        i = 1;
        c = 2;
        x = a / b;
        least = pow(10, -8);
        result = 0;
       
        while(x > least)
        {
                result = i * x + result;
                b = b + c;
                x = a / b;
                i = -i;
        }
        printf("四分之Π的近似值是:%.7f", result);
       
        return 0;
}

#include <stdio.h>

int main()
{
        int money, year, cost;
        float lixi;
       
        money = 400;
        year = 0;
        cost = 50;
        lixi = 0.08;
       
        while (money > 0)
        {
                money = money - cost;
                money = money + money * lixi;
                year++;
        }
       
        printf("经过了%d年,小甲鱼一贫如洗!", year);
       
        return 0;
}

#include <stdio.h>

int main()
{
        int year, J_money, H_money, money;
       
        float J_lixi, H_lixi;
       
        money = 10000;
        J_money = 10000;
        H_money = 10000;
        J_lixi = 0.1;
        H_lixi = 0.05;
        year = 0;
       
        while (J_money >= H_money)
        {
                J_money = money * J_lixi + J_money;
               
                H_money = H_money * H_lixi + H_money;
               
                year++;
        }
       
        printf("经过了%d年!\n", year);
        printf("小甲鱼有%d的钱!\n", J_money);
        printf("黑夜有%d的钱!\n", H_money);
       
        return 0;
}


#include <stdio.h>

int main()
{
        while(1)
        {
                scanf("%d,", &score);
                if (score < 0)
                {
                        printf("count = %d\n", count);
                        break;
                }
                else
                {
                        count++;
                }
        }
       
        return 0;
}

#include <stdio.h>

int main()
{
        int ibex, a = 14, b = 2, sheds, help;
       
        scanf("%d", &ibex);
       
        if (ibex > a)
        {
                sheds = 3;
        }
        else
        {
                sheds = 2;
                help = 2 * sheds;
        }
       
        return 0;
}


#include <stdio.h>

int main()
{
        int size, a, b;
       
        float cost, bill;
       
        scanf("%d", &size);
       
        if (size > 12)
        {
                cost = cost * 1.05;
        }
        else
        {
                bill = cost * flag;
        }
       
        return 0;
}

2679621537 发表于 2021-11-24 19:15:19

1

rzf嘟嘟嘟 发表于 2021-11-24 20:32:22

123

wt598168240 发表于 2021-11-24 21:03:13

23415

小超超超 发表于 2021-11-24 21:20:25

做完啦

zzc13933 发表于 2021-11-25 15:00:29

fishc

斜下的雨 发表于 2021-11-26 19:11:41

1

筱海 发表于 2021-11-26 23:22:54

答案

Pique 发表于 2021-11-27 12:42:52

1

YingNong 发表于 2021-11-27 13:44:30

答案

帕秋莉海灵顿 发表于 2021-11-27 22:41:56

0.10次
1.没有
2.5
3.14,5,9
4.if(x<0)x=-x;z=x;

920489811 发表于 2021-11-28 15:11:04

{:9_220:}

哈哈1234 发表于 2021-11-28 22:08:13

答案

CccC! 发表于 2021-11-29 10:14:38

#include <stdio.h>
#include<math.h>
int main()
{
    double i=10000, j=10000;
    int y=1;
    while (y>0)
    {
      i = 10000 + 10000 * 0.1 * y;
      j = 10000 * pow((1 + 0.05), y);
      if (j > i)
      {
            break;
      }
      y++;

    }
    printf("%d年后资产超越\n", y);
    printf("投资额为:%.2f\n", i);
    printf("投资额为:%.2f\n", j);
    return 0;

}

#include <stdio.h>
#include<math.h>
int main()
{
    double i=4000000;
    int y=1;
    while (y>0)
    {
      i = i - 500000;
      i = i * (1 + 0.08);
      if (i<=0)
      {
            break;
      }
      y++;

    }
    printf("%d年后资产败光\n", y);
   
   
    return 0;

}

#include <stdio.h>
#include<math.h>
int main()
{
    int i, j, p;
    p = 2;
    scanf_s("%d", &i);
    i = i * 12;
    for (j = 1; j <= i; j++)
    {
      p = p + 2 * (j - 1);
    }
    printf("%d\n", p);
    return 0;

}

crispTT 发表于 2021-11-29 20:20:15

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