小编xdr*_*dry的帖子

C程序不会编译

我正在参加编程,我有一位不太参与的教授.不幸的是,这个课程充满了像我这样的新手,所以没有帮助.我必须使用输入/输出,赋值语句和算术创建一个税收计算器.我的朋友实际上帮我修改了一些代码并在发送给我之前编译了它.我没有改变任何东西,但它对我不起作用.

#include <stdio.h>
#include <stdlib.h>

int main()
{
    const double TAX_RATE = 0.075;
    double item1 = 0, item2 = 0, item3 = 0;

    printf("Enter the price of the first item: \n");
    scanf("%lf", &item1);

    printf("You entered %.2lf \n", item1);
    printf("Enter the price of the second item: \n");
    scanf("%lf", &item2);

    printf("You entered %.2lf \n", item2);
    printf("Enter the price of the third item: \n");
    scanf("%lf", &item3);

    double total = item1 + item2 + item3;
    double tax = total * TAX_RATE;
    double totalWithTax = …
Run Code Online (Sandbox Code Playgroud)

c

0
推荐指数
1
解决办法
1万
查看次数

标签 统计

c ×1