《C Primer Plus》第7章复习题与编程练习

[C primer plus] 编程练习 ——第七章 【c prime plus】 编程练习 第七章 阅读详情

复习题

1. 判断下列表达式是true还是false

a. 100 > 3 && ‘a’>‘c’
b. 100 > 3 || ‘a’>‘c’
c. !(100>3)

a. false

b. true

c. false

2. 根据下列描述的条件,分别构造一个表达式:

a. number等于或大于90,但是小于100
b. ch不是字符q或k
c. number在1~9之间(包括1和9),但不是5
d. number不在1~9之间

a. number >= 90 && number < 100

b. ch != 'q' && ch != 'k'

c. number >= 1 && number <= 9 && number != 5

d. !(number >= 1 && number <= 9)

3. 下面的程序关系表达式过于复杂,而且还有些错误,请简化并改正

#include <stdio.h> 
int main(void)                  /* 1 */ {                        /* 2 */ 
    int weight, height; /* weight以磅为单位,height以英寸为单位 *//* 4 */ 
    scanf("%d , weight, height);          /* 5 */ 
    if (weight < 100 && height > 64)        /* 6 */ 
        if (height >= 72)             /* 7 */ 
            printf("You are very tall for your weight.\n"); 
        else if (height < 72 &&> 64)        /* 9 */ 
            printf("You are tall for your weight.\n");/* 10 */ 
    else if (weight > 300 && !(weight <= 300)  /* 11 */ 
    && height < 48)            /* 12 */ 
    if (!(height >= 48))            /* 13 */ 
        printf(" You are quite short for your weight.\n");
    else                     /* 15 */ 
        printf("Your weight is ideal.\n");      /* 16 */ /* 17 */ 
    return 0; 
}

改正:

#include <stdio.h> 
int main(void)                   
{                        
    int weight, height; /* weight以磅为单位,height以英寸为单位 */
    scanf("%d %d", &weight, &height);           
    if (weight < 100 && height > 64)        
        if (height >= 72)             
            printf("You are very tall for your weight.\n"); 
        else        /* 9 */ 
            printf("You are tall for your weight.\n");
    else if (weight > 300 && height < 48)                      
        printf(" You are quite short for your weight.\n");
    else                    
        printf("Your weight is ideal.\n");      
    return 0; 
}

4. 下列个表达式的值是多少

a.5 > 2
b.3 + 4 > 2 && 3 < 2
c.x >= y || y > x
d.d = 5 + ( 6 > 2 )
e.‘X’ > ‘T’ ? 10 : 5
f.x > y ? y > x : x > y

a. 1        b. 0        c. 1        d. 6        e. 10        f. 0

5. 下面的程序将打印什么

#include <stdio.h> 
int main(void) 
{ 
    int num; 
    for (num = 1; num <= 11; num++) 
    { 
        if (num % 3 == 0) 
            putchar('$'); 
        else 
            putchar('*'); 
        putchar('#'); 
        putchar('%'); 
    }
    putchar('\n'); 
    return 0; 
}

*#%*#%#%*#%*#%$#%*#%*#%

6. 下面的程序将打印什么

#include <stdio.h> 
int main(void) 
{ 
    int i = 0; 
    while (i < 3) 
    { 
        switch (i++) 
        { 
            case 0: 
                printf("fat "); 
            case 1: 
                printf("hat "); 
            case 2: 
                printf("cat "); 
            default: 
                printf("Oh no!"); 
        } 
        putchar('\n'); 
    } 
    return 0; 
}
fat hat cat Oh no!

hat cat Oh no!

cat Oh no!

7. 下面的程序有哪些错误

#include <stdio.h> 
int main(void) 
{ 
    char ch; 
    int lc = 0; // 统计小写字母 
    int uc = 0; // 统计大写字母 
    int oc = 0; // 统计其他字母 
    while ((ch = getchar()) != '#') 
    { 
        if ('a' <= ch >= 'z') 
            lc++; 
        else if (!(ch < 'A') || !(ch > 'Z') 
            uc++; 
        oc++; 
    } 
    printf(%d lowercase, %d uppercase, %d other, lc, uc, oc); 
    return 0; 
}

改正后:

#include <stdio.h> 
int main(void) 
{ 
    char ch; 
    int lc = 0; // 统计小写字母 
    int uc = 0; // 统计大写字母 
    int oc = 0; // 统计其他字母 
    while ((ch = getchar()) != '#') 
    { 
        if ('a' <= ch && ch <= 'z') 
            lc++; 
        else if (!(ch < 'A') && !(ch > 'Z') 
            uc++; 
        else:
            oc++; 
    } 
    printf("%d lowercase, %d uppercase, %d other", lc, uc, oc); 
    return 0; 
}

8. 下面的程序将打印什么

#include <stdio.h> 
int main(void)
{ 
    int age = 20; 
    while (age++ <= 65) 
    { 
        if ((age % 20) == 0) /* age是否能被20整除? */ 
            printf("You are %d.Here is a raise.\n", age); 
        if (age = 65) 
            printf("You are %d.Here is your gold watch.\n", age); 
    } 
    return 0; 
}

重复打印You are 65.Here is your gold watch.
【每一次赋值都会重置age为65】

9. 给定下面的输入时,以下程序将打印什么

q
c
h
b

#include <stdio.h> 
int main(void) 
{ 
    char ch; 
    while ((ch = getchar()) != '#') 
    { 
        if (ch == '\n') 
            continue; 
        printf("Step 1\n"); 
        if (ch == 'c') 
            continue; 
        else if (ch == 'b') 
            break; 
        else if (ch == 'h') 
            goto laststep; 
        printf("Step 2\n"); 
laststep: 
        printf("Step 3\n"); 
    } 
    printf("Done\n"); 
    return 0; 
}
Step 1

Step 2

Step 3

Step 1

Step 1

Step 3

Step 1

Done

10. 重写复习题9,但这次不能使用continue和goto语句

#include <stdio.h> 
int main(void) 
{ 
    char ch; 
    while ((ch = getchar()) != '#') 
    { 
        if (ch == '\n') 
        else
        {
            printf("Step 1\n"); 
            if (ch == 'c') 
            else 
            {
                if (ch == 'b') 
                    break; 
                else if (ch == 'h')
                else 
                    printf("Step 2\n"); 
                printf("Step 3\n"); 
            }
        }
    } 
    printf("Done\n"); 
    return 0; 
}

编程练习

1. 统计字符数量

编写一个程序读取输入,读到#字符停止,然后报告读取的空格数、换行符数和所有其他字符的数量。

代码:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void)
{
    char ch;
    int blank = 0, newline = 0, other = 0;
    while ((ch = getchar()) != '#')
    {
        switch (ch)
        {
        case ' ':
            blank++;
            break;
        case '\n':
            newline++;
            break;
        default:
            other++;
        }
    }
    printf("空格数:%d,换行符数:%d,其他字符数:%d\n", blank, newline, other);

    system("pause");
    return 0;
}

2. 打印“字符-ASCII码”组合

编写一个程序读取输入,读到#字符停止。程序要打印每个输入的字符以及对应的ASCII码(十进制)。一行打印8个“字符-ASCII码”组合。建议:使用字符计数和求模运算符(%)在每8个循环周期时打印一个换行符。

代码:

#include <stdio.h>
#include <stdlib.h>
int main(void)
{
    char ch;
    int count=0;

    while ((ch = getchar()) != '#')
    {
        count++;
        putchar(ch);
        printf("-%d ", ch);
        if(count % 8 == 0)
        {
            printf("\n");
        }
    }
    printf("\n");
    
    system("pause");
    return 0;
}

3. 统计奇偶数

编写一个程序,读取整数直到用户输入 0。输入结束后,程序应报告用户输入的偶数(不包括 0)个数、这些偶数的平均值、输入的奇数个数及其奇数的平均值。

代码:

#include <stdio.h>
#include <stdlib.h>
int main(void)
{
    int number;
    int count_even = 0, count_odd = 0;
    int sum_even = 0, sum_odd = 0;

    while (scanf("%d", &number) == 1 && number != 0)
    {
        if (number % 2)
        {
            count_odd++;
            sum_odd += number;
        }
        else
        {
            count_even++;
            sum_even += number;
        }
    }
    printf("奇数个数:%d,奇数平均值:%f\n偶数个数:%d,偶数平均值:%f\n", count_odd, (float)sum_odd / count_odd, count_even, (float)sum_even / count_even);

    system("pause");
    return 0;
}

4. 字符替换

使用if else语句编写一个程序读取输入,读到#停止。用感叹号替换句号,用两个感叹号替换原来的感叹号,最后报告进行了多少次替换。

代码:

#include <stdio.h>
#include <stdlib.h>
int main(void)
{
    char ch;
    int replace_period = 0, replace_exclamation = 0;

    while ((ch = getchar()) != '#')
    {
        if (ch == '.')
        {
            printf("!");
            replace_period++;
        }
        else if (ch == '!')
        {
            printf("!!");
            replace_exclamation++;
        }
        else
        {
            putchar(ch);
        }
    }
    printf("\n替换句号%d次,替换感叹号%d次。\n", replace_period, replace_exclamation);

    system("pause");
    return 0;
}

5. 使用switch重写练习4

代码:

#include <stdio.h>
#include <stdlib.h>
int main(void)
{
    char ch;
    int replace_period = 0, replace_exclamation = 0;

    while ((ch = getchar()) != '#')
    {
        switch (ch)
        {
        case '.':
            printf("!");
            replace_period++;
            break;
        case '!':
            printf("!!");
            replace_exclamation++;
            break;
        default:
            putchar(ch);
        }
    }
    printf("\n替换句号%d次,替换感叹号%d次。\n", replace_period, replace_exclamation);

    system("pause");
    return 0;
}

6. 报告ei出现的次数

编写程序读取输入,读到#停止,报告ei出现的次数。

代码:

#include <stdio.h>
#include <stdlib.h>
int main(void)
{
    char ch;
    int count = 0; //计数ei出现的次数
    bool condition = false; //触发条件

    while ((ch = getchar()) != '#')
    {
        if (ch == 'e')
        {
            condition = true;
        }
        if (ch == 'i' && condition == true)
        {
            count++;
            condition = false;
        }
        else if (ch != 'e')
        {
            condition = false;
        }
    }
    printf("ei出现了%d次\n", count);

    system("pause");
    return 0;
}

7. 打印工资总额、税金和净收入

编写一个程序,提示用户输入一周工作的小时数,然后打印工资总额、税金和净收入。做如下假设:
a.基本工资 = 10美元/小时
b.加班(超过40小时) = 1.5倍的时间
c.税率: 前300美元为15%
续150美元为20%
余下的为25%

用#define定义符号常量。不用在意是否符合当前的税法。

代码:

#include <stdio.h>
#include <stdlib.h>
#define BASIC_SALARY_UNIT 10.00 //基本工资
#define BASIC_TIME 40           //不加班的最长工作时间
#define RATIO 1.5               //倍率
#define FRONT_TAX 0.15          // 前300美元
#define ADD_TAX 0.20            //续150美元
#define REMAINING_TAX 0.25      // 余下的
#define FRONT_SALARY 300        // 300美元
#define ADD_SALARY 150          // 150美元
int main(void)
{
    int time;            //工作时间
    float salary = 0.0;  // 工资总额
    float tallage = 0.0; // 税金

    printf("请输入一周工作的小时数: ");
    scanf("%d", &time);
    // 计算salary
    if (time > 0 && time <= BASIC_TIME)
    {
        salary = BASIC_SALARY_UNIT * time;
    }
    else if (time > BASIC_TIME)
    {
        salary = BASIC_SALARY_UNIT * ((time - BASIC_TIME) * RATIO + BASIC_TIME);
    }
    // 计算tallage
    if (salary <= FRONT_SALARY)
    {
        tallage = salary * FRONT_TAX;
    }
    else if (salary < FRONT_SALARY + ADD_SALARY)
    {
        tallage = FRONT_SALARY * FRONT_TAX + (salary - FRONT_SALARY) * ADD_TAX;
    }
    else
    {
        tallage = FRONT_SALARY * FRONT_TAX + ADD_SALARY * ADD_TAX + (salary - FRONT_SALARY - ADD_SALARY) * REMAINING_TAX;
    }
    printf("工资总额为:%f\n税金为:%f\n净收入为:%f\n", salary, tallage, salary - tallage);

    system("pause");
    return 0;
}

8. 工资等级菜单

修改练习7的假设a,让程序可以给出一个供选择的工资等级菜单。使用switch完成工资等级选择。运行程序后,显示的菜单应该类似这样:

*****************************************************************
Enter the number corresponding to the desired pay rate or action:
1) $8.75/hr                            2) $9.33/hr
3) $10.00/hr                          4) $11.20/hr
5) quit
*****************************************************************

如果选择 1~4 其中的一个数字,程序应该询问用户工作的小时数。程序要通过循环运行,除非用户输入 5。如果输入 1~5 以外的数字,程序应提醒用户输入正确的选项,然后再重复显示菜单提示用户输入。使用#define创建符号常量表示各工资等级和税率。

代码:

#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#define PAY_RATE1 8.75
#define PAY_RATE2 9.33
#define PAY_RATE3 10.00
#define PAY_RATE4 11.20
#define TIME_BASE 40
#define OVERTIME 1.5
#define BREAK1 300
#define BREAK2 450
#define RATE1 0.15
#define RATE2 0.20
#define RATE3 0.25

int main(void)
{
    int num;
    bool judge = false; // 这里的标志位必须为false,以防用户一开始就输入非数字
    double pay_rate;
    double hours;
    double gross, tax, net;

    printf("*****************************************************************\n");
    printf("Enter the number corresponding to the desired pay rate or action:\n");
    printf("1) $8.75/hr         2) $9.33/hr\n");
    printf("3) $10.00/hr        4) $11.20/hr\n");
    printf("5) quit\n");
    printf("******************************************************************\n");
    //读取正确输入,直达是1-5之间才退出循环
    while (scanf("%d", &num) == 1)
    {
        judge = true; //每次循环标志位置为true
        switch (num)
        {
        case 1:
            pay_rate = PAY_RATE1;
            break;
        case 2:
            pay_rate = PAY_RATE2;
            break;
        case 3:
            pay_rate = PAY_RATE3;
            break;
        case 4:
            pay_rate = PAY_RATE4;
            break;
        case 5:
            printf("Bye!\n");
            break;
        default:
            printf("\nPlease enter the right number!\n");
            printf("*****************************************************************\n");
            printf("Enter the number corresponding to the desired pay rate or action:\n");
            printf("1) $8.75/hr         2) $9.33/hr\n");
            printf("3) $10.00/hr        4) $11.20/hr\n");
            printf("5) quit\n");
            printf("******************************************************************\n");
            judge = false;
        }

        if (judge)
            break;
    }
    if (judge && num != 5)
    {
        printf("Enter your work hours in a week: ");
        scanf("%lf", &hours);
        if (hours > TIME_BASE)
            hours = TIME_BASE + (hours - TIME_BASE) * OVERTIME;
        gross = hours * pay_rate;
        if (gross < BREAK1)
            tax = gross * RATE1;
        else if (gross < BREAK2)
            tax = BREAK1 * RATE1 + (gross - BREAK1) * RATE2;
        else
            tax = BREAK1 * RATE1 + (BREAK2 - BREAK1) * RATE2 + (gross - BREAK2) * RATE3;
        net = gross - tax;
        printf("gross: %.2lf, tax: %.2lf, net: %.2lf\n", gross, tax, net);
    }

    system("pause");
    return 0;
}

9. 显示素数

编写一个程序,只接受正整数输入,然后显示所有小于或等于该数的素数。

代码:

#include <stdio.h>
#include <stdlib.h>
int main(void)
{
    int number;
    bool isPrime;

    scanf("%d", &number);
    for (int i = 2; i <= number; i++)
    {
        isPrime = true;
        for (int j = 2; j * j <= i; j++)
        {
            if (i % j == 0)
            {
                isPrime = false;
            }
        }
        if (isPrime)
        {
            printf("%d是素数。\n", i);
        }
    }

    system("pause");
    return 0;
}

10. 计算税金

1988年的美国联邦税收计划是近代最简单的税收方案。它分为4个类别,每个类别有两个等级。 下面是该税收计划的摘要(美元数为应征税的收入):在这里插入图片描述
例如,一位工资为20000美元的单身纳税人,应缴纳税0.15×17850+0.28×(20000−17850)美元。编写一个程序,让用户指定缴纳税金的种类和应纳税收入,然后计算税金。程序应通过循环让用户可以多次输入。

代码:

#include <stdio.h>
#include <stdlib.h>
#define BASEPAY1 17850
#define BASEPAY2 23900
#define BASEPAY3 29750
#define BASEPAY4 14875
#define RATE1 0.15
#define RATE2 0.28
void print_prompt();
int main(void)
{
    int type;
    double income;
    double basepay;
    double tax;

    print_prompt();
    while (scanf("%d", &type) == 1)
    {
        switch (type)
        {
        case 1:
            basepay = BASEPAY1;
            break;
        case 2:
            basepay = BASEPAY2;
            break;
        case 3:
            basepay = BASEPAY3;
            break;
        case 4:
            basepay = BASEPAY4;
            break;
        }
        if (type > 0 && type < 5)
        {
            printf("Enter your income: ");
            scanf("%lf", &income);
            printf("\n");
            if (income <= basepay)
            {
                tax = income * RATE1;
            }
            else
            {
                tax = BASEPAY1 * RATE1 + (income - BASEPAY1) * RATE2;
            }
            printf("Your tax is %lf.\n", tax);
            print_prompt();
        }
        else if (type == 5)
        {
            printf("Bye!\n");
            break;
        }
        else
        {
            printf("Please enter right number.\n");
            print_prompt();
        }
    }

    system("pause");
    return 0;
}
void print_prompt()
{
    printf("*****************************************************************\n");
    printf("Enter the number corresponding to the desired tax type or action:\n");
    printf("1) 单身             2) 户主\n");
    printf("3) 已婚,共有       4) 已婚,离异\n");
    printf("5) quit\n");
    printf("******************************************************************\n");
}

11. ABC 邮购杂货店

ABC 邮购杂货店出售的洋蓟售价为 2.05 美元/磅,甜菜售价为 1.15 美元/磅,胡萝卜售价为 1.09美元/磅。在添加运费之前,100美元的订单有5%的打折优惠。少于或等于5磅的订单收取6.5美元的运费和包装费,5磅~20磅的订单收取14美元的运费和包装费,超过20磅的订单在14美元的基础上每续重1磅增加0.5美元。

编写一个程序,在循环中用switch语句实现用户输入不同的字母时有不同的响应,即输入a的响应是让用户输入洋蓟的磅数,b是甜菜的磅数,c是胡萝卜的磅数,q 是退出订购。程序要记录累计的重量。即,如果用户输入 4 磅的甜菜,然后输入 5磅的甜菜,程序应报告9磅的甜菜。然后,该程序要计算货物总价、折扣(如果有的话)、运费和包装费。随后,程序应显示所有的购买信息:物品售价、订购的重量(单位:磅)、订购的蔬菜费用、订单的总费用、折扣(如果有的话)、运费和包装费,以及所有的费用总额

代码:

#include <stdio.h>
#include <stdlib.h>
// 蔬菜单价
#define MOSS_UNIT 2.05
#define BEET_UNIT 1.15
#define CARROT_UNIT 1.09
// 打折信息
#define DISCOUNT 100
#define DISCOUNT_PERCENT 0.05
// 重量收费标准
#define POUND_5 6.5
#define POUND_5_20 14
#define POUND_20 0.5
int main(void)
{
    char option;         // 蔬菜选项
    float moss = 0;      // 洋藓计数器
    float beet = 0;      // 甜菜计数器
    float carrot = 0;    // 胡萝卜计数器
    float expense;       // 初始费用
    float all_expense;   // 蔬菜减去折扣的总费用
    float weight;        // 总重量
    float add;           // 每次添加的蔬菜重量
    float discount = -1; // 折扣
    float freight = 0;   // 运费和包装费用
    printf("请输入你要购买的蔬菜选项:\n");
    printf("a)洋藓 2.05美元/磅\nb)甜菜 1.15美元/磅\nc)胡萝卜 1.09美元/磅\nq)结束选择\n");
    while ((option = getchar()) != 'q')
    {
        switch (option)
        {
        case 'a':
            printf("请输入重量:");
            scanf("%f", &add);
            moss += add;
            printf("洋藓----%f磅\n\n", moss);
            break;
        case 'b':
            printf("请输入重量:");
            scanf("%f", &add);
            beet += add;
            printf("甜菜----%f磅\n\n", beet);
            break;
        case 'c':
            printf("请输入重量:");
            scanf("%f", &add);
            carrot += add;
            printf("胡萝卜---%f磅\n\n", carrot);
            break;
        }
        while (getchar() != '\n')
            continue;
        printf("选择蔬菜:");
    }
    expense = moss * MOSS_UNIT + beet * BEET_UNIT + carrot * CARROT_UNIT;
    if (expense > DISCOUNT)
    {
        discount = expense * DISCOUNT_PERCENT;
        all_expense = expense - discount;
    }
    else
    {
        all_expense = expense;
    }
    weight = moss + beet + carrot;
    if (weight <= 5)
    {
        freight = POUND_5;
    }
    else if (weight > 5 && weight <= 20)
    {
        freight = POUND_5_20;
    }
    else
    {
        freight = (weight - 20) * POUND_20 + POUND_5_20;
    }
    all_expense += freight;
    printf("**************************************************\n");
    if (moss > 0)
    {
        printf("洋藓 2.05美元/磅----%f磅\n", moss);
    }
    if (beet > 0)
    {
        printf("甜菜 1.15美元/磅----%f磅\n", beet);
    }
    if (carrot > 0)
    {
        printf("胡萝卜 1.09美元/磅--%f磅\n", carrot);
    }
    printf("订购的总重量----------%f(磅)\n", weight);
    printf("订购的蔬菜总费用------%f美元\n", expense);
    if (discount > 0)
    {
        printf("折扣------------------%f美元\n", discount);
    }
    printf("运费包装费用----------%f美元\n", freight);
    printf("所有的费用总额--------%f美元\n", all_expense);
    printf("**************************************************\n");

    system("pause");
    return 0;
}
C Primer Plus (第六版)第七章 编程 练习题 部分 解答 C Primer Plus (第六版)第七章 编程练习题 部分答题代码 最近在学习C Primer Plus ,以下是其中第七章编程题,我写的代码。已测试通过。(IDE :Codeblocks),不妥之处请指正 1.读取输入读到#字符停止,然后报告读取的空格数、换行数和所有其他字符 #include &amp;lt;stdio.h&amp;gt; int main(void) { char ch; ... 阅读详情

相关推荐

C Primer Plus 第6版 编程练习 chapter 7

C primer plus 第6版 chapter 7 编程练习

Bell_corp的博客 1168

C Primer Plus 第6版 第7章编程题-11题全

1.编写一个程序读取输入,读到#字符停止,然后报告读取的空格数、换行符数和所有其他字符的数量。 #include <stdio.h> #include <ctype.h> ​ int main(void ){ char ch = 0 ; int spaces = 0; int lines = 0; int charactors = 0; while((ch = getchar()) != '#'){ if(ch == ' '...

Litbai_zhang 1330

C primer plus 复习题答案(上)

C primer plus 复习题答案 第一章 初识C语言 ​ 对编程而言,可移植性意味着什么 在软件工程中,可移植性,又译为移植性、可携性,是指使用高阶语言写成的软件,在不同环境下,是否具备可以被重复使用的性质。一般来说,软件是否具备可移植性的衡量标准,在于进行软件移植时,需要付出多少工时为代价。具备高可移植性的软件,在移植到不同系统平台时,并不需要做太多事情,因此能够减少软件开发及布署时的成本。为了使软件具备高度可移植性,程序员需要使应用程序界面抽象化以及模组化。 以低阶语言,例如汇编语言,写成的软

Jonathan的博客 3万+

2020-06-30

编写一个程序读取输入,读到#字符停止。程序要打印每个输入的字符以及对应的ASCII码(十进制)。每行打印8个字符“字符-ASCLL码”组合。建议:使用字符计数和求模运算符(%)在每8个循环周期时打印一个换行符。 #include<stdio.h> int main(void) { char ch; int i = 0; printf("please enter character\n"); while ((ch = getchar())!='#') { if (i % 8 == 0

weixin_46332624的博客 496

《C Primer Plus》第 11 章复习题和编程练习

《C Primer Plus》第 11 章复习题和编程练习

潇雪的博客 1132

C Primer Plus 附录A 复习题答案

C Primer Plus 附录A 复习题答案

C Primer Plus 第7章习题

P212~P216

weixin_45641816的博客 1068

C Primer Plus 第七章编程练习(第10题)

#include <stdio.h> #define SINGLE 17850 /*单身缴纳税金基础*/ #define HEAD_OF_A_HOUSEHOLD 23900 /*户主缴纳税金基础*/ #define MARRIED 29759 /*已婚缴纳税金基础*/ #define DIVORCE 14875 /*离异缴纳税金基础*/ #define BASE 0.15 /*基...

CrookedCr的博客 356

组合导航、惯导、GNSS、INS、IMU的区别

‌:惯性导航系统(INS)是一种利用安装在运载体上的陀螺仪和加速度计来测定运载体位置的系统。它通过测量物体的加速度和角速度,结合算法计算出物体的位置、速度和姿态‌12。‌。

wynn1123的博客 8100

无人机巡检提速3倍!YOLOv8n+OpenVINO让Jetson Nano跑25FPS,还能多飞25分钟

摘要(149字): 针对无人机巡检中Jetson Nano算力不足导致的帧率低、首次推理延迟高、续航短等问题,提出YOLOv8n+OpenVINO联合优化方案: 模型轻量化:YOLOv8n参数量仅3.2M(较v8s减少71%),Jetson Nano帧率从8FPS提升至15FPS(原生),绝缘子裂纹召回率仅降3%; OpenVINO加速:AUTO模式动态分配CPU/GPU算力,首次推理延迟从500ms降至200ms,帧率再优化至25FPS; 能效提升:功耗降低40%,单次续航延长25分钟。方案已落地电力/林

专注于Python爬虫开发,分享爬虫技巧、项目实战与反爬经验,使用Scrapy、BeautifulSoup等工具,解决数据抓取难题。 1246

C Primer Plus 第四章 编程练习

1.编写一个程序,提示用户输入名和姓,然后以“名,姓”的格式打印出来。 1 #include<stdio.h> 2 3 int main() 4 { 5 char first_name[20]; //名 6 char last_name[20]; //姓 7 8 printf("请输入名:"); 9 ...

weixin_34402090的博客 157

更多 LSTM 变种——应用于 CMAPSS 数据集

本文并模型介绍,只是把一些比较火的技术,像双向注意力机制,自注意力机制这样的比较火的内容,简单的和LSTM堆叠,结果发现效果都不如最基础的,这里作者将本人代码及实现结果,进行展示,给各位想更改LSTM的朋友一些。

2301_77491330的博客 1782

《C Primer Plus》第11章复习题与编程练习

《C Primer Plus》第11章复习题与编程练习

ProgramNovice的博客 1641

Doris存储层设计介绍2——数据写入及删除流程

Doris存储层设计介绍2——数据写入及删除流程

爱吃辣条的博客 4599

MATLAB安装配置libsvm(附MinGW64配置)

首先声明版本,本人PC系统Windows10 64bit,matlab安装的2016b,libsvm安装的version3.2.21.首先需要下载libsvm包:从林教授的网站上下载: http://www.csie.ntu.edu.tw/~cjlin/libsvm/2.将libsvm3.2.2解压到matlab/toolbox目录下:解压后:D:\matlab2016b\toolbox\libs...

github_35807147的博客 4万+

《C Primer Plus》第 8 章复习题和编程练习

《C Primer Plus》第 8 章复习题和编程练习

潇雪的博客 1415

MMWCAS-DSP-EVM与AWR2243实战:从开箱到数据采集的完整避坑指南

本文提供了MMWCAS-DSP-EVM与AWR2243毫米波雷达评估板从开箱、软硬件准备、固件烧录到数据采集的完整实战指南。重点解析了硬件连接、软件版本匹配、固件烧录、网络配置及MMWave Studio GUI操作等关键步骤,并汇总了常见问题排查方法,帮助开发者快速上手并规避常见陷阱。

algae的博客 507

《C Primer Plus》第10章复习题与编程练习

《C Primer Plus》第10章复习题与编程练习

ProgramNovice的博客 1144

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

《C Primer Plus》第10 章复习题和编程练习

《C Primer Plus》第 10 章复习题和编程练习

潇雪的博客 1521

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

《C Primer Plus》第 2 章复习题和编程练习

《C Primer Plus》第 2 章复习题和编程练习

潇雪的博客 1568

贝叶斯统计 [韦来生编]

贝叶斯(Bayes)统计是近几十年来迅速发展起来的数理统计的一个重要分支。贝叶斯方法与经典统计方法的主要不同之处是进行统计推断时除了利用样本信息外,还要利用参数的先验信息,因此可以提高统计推断或统计决策的效果。它在经济、金融、生物、医学、自然科学和社会科学等许多领域具有广泛的应用。贝叶斯方法的研究已渗透到了统计学的几乎所有领域。作者在给中国科学技术大学概率论与数理统计专业本科生开设的“数理统计”课程中有一章专门讲授“贝叶斯方法和统计决策理论”,近十年来也给中国科学技术大学概率统计专业研究生开设过几次“贝叶斯分析”课。本书是在对过去讲稿的内容作了适当的增减和调整的基础上完成的。  本书共分六章。第1章是绪论,介绍了贝叶斯统计的若干基本概念,同时对必要的数理统计的基础知识有重点地作了回顾。第二章介绍了确定先验分布的若干可供选择的方法。第三章介绍了几类常见统计模型参数的后验分布的主要结果和计算方法。第四章和第五章分别介绍了“贝叶斯统计推断”和“贝叶斯统计决策”的内容。第六章介绍了贝叶斯统计计算的若干方法,包括蒙特卡洛方法和马尔可夫链蒙特卡洛(MCMC)方法以及相关统计软件的简介。本书的每一章附右大量的例题和习题,书末附有常用的几个表格和部分习题解答供读者查用。  大约可在54学时内讲授本书的第1章至第六章的主要内容,教师可根据学时需要选讲本书第1章至第六章的部分内容。书中标“*”号的章节可略去不讲,留给读者作为阅读材料。第六章例题中的R代码和部分例题的数据文件等可从作者个人主页下载。  作者在编写本书的过程中参考了J.O.Berger教授的《统计决策论及贝叶斯分析》和茆诗松教授编写的《贝叶斯统计》等书中的一些内容,以及《贝叶斯分析》一书中由张伟平博士编写的有关贝叶斯统计计算的一些内容。在此表示衷心感谢。  本书编写准备过程中,中国科学技术大学统计与金融系的几个研究生帮助完成了本书部分中文的录入和排版,作者对他们的辛勤工作表示真诚的感谢。高等教育出版社为本书的出版给予了大力支持。在此一并致谢。

《C Primer Plus》第 9 章复习题和编程练习

《C Primer Plus》第 9 章复习题和编程练习

潇雪的博客 1477

《C Primer Plus》第9章复习题与编程练习

《C Primer Plus》第9章复习题与编程练习

ProgramNovice的博客 840

C Primer Plus 第二章:C语言概述 ~~~ 复习题与编程练习的答案与详解

第二章:C语言概述 ~~~ 复习题与编程练习的答案与详解 目录 一、复习题(答案参考该书附录,解析为读者编写) 二、编程练习 一、复习题(答案参考该书附录,解析为读者编写) 1、C语言的基本模块是什么? 函数 2、什么是语法错误?写出一个英语例子和C语言例子。 语法错误违反了组成语句或程序的规则。这是一个有语法错误的英文例子: Me speak Engl...

sumjess 1432

C Primer Plus 第六章 复习题&编程练习 答案

第六章 复习题&编程练习1. 写出执行完下列各行后quack的值是多少。后5行中使用的是前一行生成的quack的值。2. 假设value是int类型,下面循环的输出是什么?如果value是double类型,会出现什么问题?3. 用代码表示以下测试条件:4. 用代码表示以下测试条件:5. 下面的程序有点问题,请找出问题所在。6. 编写一个程序打印下面的图案,要求使用嵌套循环:7. 下面的程...

May21☀️ 4643
上一篇: 【《C Primer Plus》读书笔记】第7章:C控制语句:分支和跳转
下一篇: 人工智能与数据挖掘的关系
UestcXiye
博客等级 码龄8年 9044粉丝 1306原创
评论 4
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

UestcXiye

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址