promotion image of download ymail app
Promoted
發問時間: 社會與文化語言 · 1 0 年前

電腦程式語言

程式語言C++

請問該怎麼寫?

write c program that inputs monthly salary after tax,if tax amount=salary*10%

謝謝...........

1 個解答

評分
  • 梓月
    Lv 4
    1 0 年前
    最佳解答

    #include<stdio.h>

    int main(void){

    float salary=0;

    float tax=0;

    printf("input your salary:");

    scanf("%f",&salary);

    tax=salary*0.1;

    printf("your tax is :%.1f\n",tax);

    getchar();

    return 0;

    }

    #include<iostream>

    using namespace std;

    int main(void){

    float salary=0;

    float tax=0;

    cout<<"input your salary:";

    cin>>salary;

    tax=salary*0.1;

    cout<<"your tax is :"<<tax;

    system("PAUSE");

    return 0;

    }

    C++

    • Commenter avatar登入以對解答發表意見
還有問題?馬上發問,尋求解答。