當前位置:首頁 » 編程語言 » c語言工資統計

c語言工資統計

發布時間: 2022-05-15 21:54:13

❶ 求一個c語言程序員工工資統計

1:數據結構設計typedef struct member{ int id ; //key char name [64]; unsigned int age ; int salary ;};2: 程序結構設計 a) 輸入職工的基本信息 b) 查找(可根據姓名,ID, 年齡, 薪水) c)統計某一范圍的人數,計算平均工資值,等。 d) 輸出模塊3)程序結構設計 設計函數 記住模塊化。具體函數原型還是自己動手寫吧。根據自己的使用喜歡。4)測試和調試。

❷ c語言,模擬工資計算器,計算一個銷售人員的月工資的數量

#include<stdio.h>
void main()
{
double salry;
int day,month,year;
double daySalry;
pirintf("請輸入員工的日工資,工作時間");
scanf("%d%d%f",month,year,daySalry);
switch(month)
{
case 1: case 3: case 5:case 7: case 8:case 10:case 12: salry = daySalry*31; break;
case 2:
if(year%4==0||year/400==0)
salry = daySalry*28;
else salry = daySalry*29;
break;
case 4: case 6:case 9:case 11: salry = daysalry *30; break;
}

}

❸ 用C語言設計職工工資管理系統

#include<iostream.h>
#include<stdlib.h>
#include<string.h>
#include<iomanip.h>
using namespace std;
#define OK 1
#define ERROR 0
typedef struct LNode{
char num[20];
char name[20];
double basic;
double reward;
double total;
struct LNode *next;
}LNode,*LinkList; int initlist(LinkList &L)
{ L=(LinkList)malloc(sizeof(LNode));
L->next=NULL;
return OK;
} int DisplayInfo(LinkList L)
{
LinkList p=L->next;
if(!p)
{
cout<<"當前無記錄!"<<endl;
return ERROR;
}
cout<<"編號"<<setw(12)<<"姓名"<<setw(12)<<"基本工資"<<setw(9)<<"獎金"<<setw(12)<<"工資總額"<<endl; while(p!=NULL)
{
cout<<p->num<<setw(9)<<p->name<<setw(8)<<p->basic<<setw(12)<<p->reward<<setw(12)<<p->total<<endl;
p=p->next;
}
cout<<'\n'<<'\n';
return OK;
} int InputInfo(LinkList &L)
{
LinkList p; p=(LinkList)malloc(sizeof(LNode));
cout<<"請輸入職工工資信息:(格式如:2001001 james 1980 600 )"<<endl;
cin>>p->num;
cin>>p->name;
cin>>p->basic;
cin>>p->reward;
p->total=p->basic+p->reward;
p->next=L->next;
L->next=p; return OK;
}int DeleteByCode(LinkList &L,char key[])
{
LinkList p=L,q;
while(p->next!=NULL)
{
if(strcmp(p->next->num,key)==0)
{
q=p->next;
p->next=q->next;
free(q);
return OK;
}
p=p->next;
}
return ERROR;} int Search(LinkList L,int tag)
{
LinkList p=L->next;
if(tag==1)
{
char num[20];
cout<<"請輸入要查找職工編號號:"<<endl;
cin>>num;
while(p)
{
if(strcmp(p->num,num)==0)
{
cout<<"編號"<<setw(12)<<"姓名"<<setw(12)<<"基本工資"<<setw(9)<<"獎金"<<setw(12)<<"工資總額"<<endl;
cout<<p->num<<setw(9)<<p->name<<setw(8)<<p->basic<<setw(12)<<p->reward<<setw(12)<<p->total<<endl;
cout<<'\n';
return OK;
}
p=p->next;
}
}
else if(tag==2)
{
char name[20];
cout<<"請輸入要查找的姓名:"<<endl;
cin>>name;
while(p)
{
if(strcmp(p->name,name)==0)
{
cout<<"編號"<<setw(12)<<"姓名"<<setw(12)<<"基本工資"<<setw(9)<<"獎金"<<setw(12)<<"工資總額"<<endl;
cout<<p->num<<setw(9)<<p->name<<setw(8)<<p->basic<<setw(12)<<p->reward<<setw(12)<<p->total<<endl;
cout<<'\n';
return OK;
}
p=p->next;
}
}
else
cout<<"輸入錯誤!"<<endl;
return ERROR;}
int Sort(LinkList &L)
{
LinkList p;

LinkList q,min,w=L;
for(p=L->next;p->next;p=p->next)
{
min=p;
for(q=p->next;q;q=q->next) if(min->total>q->total)
min=q; if(min!=p)
{ strcpy(w->num,p->num);
strcpy(w->name,p->name);
w->basic=p->basic;
w->reward=p->reward;
w->total=p->total;
strcpy(p->num,min->num);
strcpy(p->name,min->name);
p->basic=min->basic;
p->reward=min->reward;
p->total=min->total;
strcpy(min->num,w->num);
strcpy(min->name,w->name);
min->basic=w->basic;
min->reward=w->reward;
min->total=w->total; }
}
return OK;
}
int change(LinkList &L)
{
LinkList p=L->next;

char q[20];
cout<<"請輸入要修改的職工編號號:"<<endl;
cin>>q;
while(p)
{
if(strcmp(p->num,q)==0)
{
cout<<"編號"<<setw(12)<<"姓名"<<setw(12)<<"基本工資"<<setw(9)<<"獎金"<<setw(12)<<"工資總額"<<endl;
cout<<p->num<<setw(9)<<p->name<<setw(8)<<p->basic<<setw(12)<<p->reward<<setw(12)<<p->total<<endl;
cout<<"請重新輸入該職工的工資信息:"<<endl;
cin>>p->basic;
cin>>p->reward;
cout<<'\n';
return OK;
}
p=p->next;
}
}
int Menu(LinkList &S)
{
int sign=1;
while(sign)
{
int i;
cout<<"請選擇要進行的操作:1:插入 2:刪除 3:輸出 4:查找 5:排序 6:修改 0:退出"<<endl;
cin>>i;
if(i==1)
{ if(InputInfo(S))
cout<<"操作成功!"<<endl;
cout<<'\n';
}
else if(i==2)
{
char num[20];
cout<<"請輸入要刪除的職工編號:"<<endl;
cin>>num; if(DeleteByCode(S,num))
cout<<"操作成功!"<<endl; else
{
cout<<"此編號不存在!"<<endl;
cout<<'\n';
}
}
else if(i==3)
DisplayInfo(S);
else if(i==4)
{
int tag;
cout<<"1:按編號查找 2:按姓名查找 "<<endl;
cin>>tag;
if(!Search(S,tag))
cout<<"未找到!"<<endl;
cout<<'\n'; }
else if(i==5)
{

if(Sort(S));
cout<<"操作成功!"<<endl;
cout<<'\n';
}
else if(i==6)
{
if(change(S))
cout<<"修改成功!"<<endl;
} else if(i==0)
sign=0;
else
cout<<"輸入有誤,請重新輸入!"<<endl;
cout<<'\n';
}
return OK;
}
int main()
{
LinkList S;
initlist(S);
Menu(S);
return OK;} 已經調試無bug 有問題的話聯系我。

❹ C語言計算工資的代碼

源代碼中,你的if語句裡面兩個表達式是用逗號分開的,這樣並不能滿足兩個條件都滿足的要求
現修改代碼如下,

#include<stdio.h>
intmain()
{
inty,t;
doublem;
scanf("%d%d",&y,&t);
if(y<5&&t<=40)//使用&&表示要求兩個條件都滿足
printf("%.2f",m=t*30);
elseif(y<5&&t>40)
printf("%.2f",m=40*30+(t-40)*30*1.5);
elseif(y>=5&&t<=40)
printf("%.2f",m=t*50);
else
printf("%.2f",m=40*50+(t-40)*50*1.5);
}

❺ c語言編一個工資管理系統 本系統能夠方便、靈活地實現職工工資的輸入、添加、刪除等編輯操作以及查詢等

*/#include "stdafx.h"
#include "iostream"
#include "string"
#include "list"
#include "cassert"
using namespace std;/*
編號、姓名、部門、應付工資、保險、稅金、實付工資。
其中實付工資由公式計算得到:實付工資=應付工資 - 保險- 稅金
*/
struct employee{
string m_num;//編號
string m_name;//姓名
string m_dep;//部門
double m_salary;//應付工資
double m_insurance;//保險
double m_tax;//稅金
};/*
(1)錄入:輸入職工數據,其中「實付工資」通過計算得到;
(2)刪除:刪除指定的職工信息(輸入姓名,若找到則刪除該信息)
(3) 修改:允許對已經錄入的數據重新進行編輯、修改;
(4) 顯示:顯示全體職工數據;
(5)查詢:
a. 輸入職工姓名,顯示該職工的全部數據;
b. 輸入某部門值,顯示該部門職工的數據、工資總額、平均工資。
(6) 退出程序。
*/list<employee> emps;int _tmain(int argc, _TCHAR* argv[])
{
void print(const employee &e);
void input();
void del();
void mod();
void show_all();
void show_name();
void show_dep();cout<<"簡易職工薪水管理程序 by 做他\n";// delete this line
cout<<"版權沒有 請隨意復制或修改任何代碼\n";//delete this linecout<<"請選擇操作:1.錄入 2.刪除 3.修改 4.查詢 5.顯示所有員工 6.退出 :";
int choose=0;
cin>>choose;
assert(!cin.fail());
while (choose!=6)
{
if (choose==1) input();
if (choose==2) del();
if (choose==3) mod();
if (choose==4)
{
int choice=0;
cout<<"請選擇操作 1.按姓名查詢 2.按部門查詢 3.退出:";
cin>>choice;
if (choice==1) show_name();
if (choice==2) show_dep();
if (choice==3)
{
cout<<"請選擇操作:1.錄入 2.刪除 3.修改 4.查詢 5.顯示所有員工 6.退出 :";
cin>>choose;
assert(!cin.fail());
continue;
}
}
if (choose==5) show_all();
cout<<"請選擇操作:1.錄入 2.刪除 3.修改 4.查詢 5.顯示所有員工 6.退出 :";
cin>>choose;
assert(!cin.fail());
}
return 0;
}void print(const employee &e)
{
cout<<"編號:"<<e.m_num<<endl;
cout<<"姓名:"<<e.m_name<<endl;
cout<<"部門:"<<e.m_dep<<endl;
cout<<"保險:"<<e.m_insurance<<endl;
cout<<"稅金:"<<e.m_tax<<endl;
cout<<"應付工資:"<<e.m_salary<<endl;
cout<<"實付工資:"<<e.m_salary-e.m_insurance-e.m_tax<<endl;
}void input()
{
string num,name,dep;
double salary,ins,tax;
cout<<"請輸入員工編號:";
cin>>num;
cout<<"請輸入員工姓名:";
cin>>name;
cout<<"請輸入員工部門:";
cin>>dep;
cout<<"請輸入員工保險:";
cin>>ins;
assert(!cin.fail());
cout<<"請輸入員工稅金:";
cin>>tax;
assert(!cin.fail());
cout<<"請輸入員工應付工資:";
cin>>salary;
assert(!cin.fail());
employee temp;
temp.m_dep=dep;
temp.m_insurance=ins;
temp.m_name=name;
temp.m_num=num;
temp.m_salary=salary;
temp.m_tax=tax;
emps.push_back(temp);
cout<<"員工錄入操作完畢.\n";
}void del()
{
if (emps.size()==0)
{
cout<<"沒有員工記錄.\n";
return;
}
string name;
bool isfind=false;
cout<<"請輸入要刪除的員工姓名:";
cin>>name;
list<employee>::iterator iter;
for (iter=emps.begin();iter!=emps.end();iter++)
{
if (iter->m_name==name)
{
isfind=true;
emps.erase(iter);
cout<<"姓名為\""<<name<<"\"的員工記錄已刪除.\n";
return;
}
}
if (!isfind)
{
cout<<"沒有找到姓名為\""<<name<<"\"的員工.\n";
return;
}
}void mod()
{
if (emps.size()==0)
{
cout<<"員工記錄為空.\n";
return;
}
bool isfind=false;
string name;
cout<<"請輸入要修改的員工姓名:";
cin>>name;
list<employee>::iterator iter;
for (iter=emps.begin();iter!=emps.end();iter++)
{
if (iter->m_name==name)
{
isfind=true;
cout<<"姓名為\""<<name<<"\"的員工記錄已找到.\n";
break;
}
}
if (isfind)
{
string num,name,dep;
double tax,ins,salary;
print(*iter);
cout<<endl;
cout<<"請輸入新的員工編號:";
cin>>num;
cout<<"請輸入新的員工姓名:";
cin>>name;
cout<<"請輸入新的員工部門:";
cin>>dep;
cout<<"請輸入新的員工保險:";
cin>>ins;
assert(!cin.fail());
cout<<"請輸入新的員工稅金:";
cin>>tax;
assert(!cin.fail());
cout<<"請輸入新的員工工資:";
cin>>salary;
assert(!cin.fail());
iter->m_dep=dep;
iter->m_insurance=ins;
iter->m_name=name;
iter->m_num=num;
iter->m_salary=salary;
iter->m_tax=tax;
cout<<"1 員工記錄被成功修改.\n";
}
else
{
cout<<"沒有找到姓名為\""<<name<<"\"的員工記錄.\n";
}
}void show_all()
{
if (emps.size()==0)
{
cout<<"員工記錄為空.\n";
return;
}
cout<<"顯示全體員工數據:\n";
cout<<"--------------------\n";
list<employee>::iterator iter;
for(iter=emps.begin();iter!=emps.end();iter++)
{
cout<<endl;
print(*iter);
cout<<endl;
}
cout<<"--------------------\n";
}void show_name()
{
if (emps.size()==0)
{
cout<<"員工記錄為空.\n";
return;
}
bool isfind=false;
string name;
cout<<"請輸入要查詢的員工姓名:";
cin>>name;
list<employee>::iterator iter;
for(iter=emps.begin();iter!=emps.end();iter++)
{
if (iter->m_name==name)
{
isfind=true;
cout<<"姓名為\""<<name<<"\"的員工記錄已找到.\n";
print(*iter);
break;
}
}
if (!isfind)
{
cout<<"沒有找到姓名為\""<<name<<"\"的員工.\n";
return;
}
}void show_dep()
{
if (emps.size()==0)
{
cout<<"員工記錄為空.\n";
return;
}
double isfind=0.00;
double total_salary=0.00;
string dep;
cout<<"請輸入要查詢的部門名稱:";
cin>>dep;
cout<<"部門["<<dep<<"]的員工信息:\n";
cout<<"--------------------\n\n";
list<employee>::iterator iter;
for(iter=emps.begin();iter!=emps.end();iter++)
{
if (iter->m_dep==dep)
{
isfind++;
total_salary+=iter->m_salary;
print(*iter);
cout<<endl;
continue;
}
}
cout<<"--------------------\n";
if (isfind==0)
{
cout<<"沒有找到名稱為["<<dep<<"]的部門.\n";
}
else
{
cout<<"部門["<<dep<<"]工資統計:\n";
cout<<"工資總額:"<<total_salary<<endl;
cout<<"平均工資:"<<total_salary/isfind<<endl;
}
}

❻ 用C語言編寫計算工人工資怎麼編寫

用C語言編寫計算工人工資怎麼編寫?

某工廠按工人的工時計算工人工資,規則如下:工資按每小時84元計發。若總工時>120小時,超過120小時的部分每小時加發15%;若總工時<60小時,則總工資扣發700元。編寫程序,從鍵盤錄入某工人的工時,程序能計算並輸出該工人的工資。(畫出程序流程圖)

❼ C語言程序員工資待遇多少

學歷,看城市,看技術。

985大學中上水平,去一線城市大公司,華為基本打底,本科8k,碩士10k
在好的就是上邊那些公司(這類公司基本只要985)了,不過說實話這些人數其實非常少。

如果不是985,是一本,可能要減2k,專科或者培訓班可能再減2k。
而如果不是一線城市(IT其實就是北京上海),二線城市可能減2k,三線可能減2k。

這是畢業生,一般來說不跳槽,一般每年工資就漲20%左右,兩三年跳槽能漲50%,如果從程序員升級到項目經理,那樣翻1倍,也正常,所以技術不是985大學的,干個三年達到月薪1w也不是特別誇張,

❽ C語言程序設計:職工工資信息統計管理系統設計

#include "stdafx.h"
#include "iostream"
#include "string"
#include "list"
#include "cassert"
using namespace std;

/*
編號、姓名、部門、應付工資、保險、稅金、實付工資。
其中實付工資由公式計算得到:實付工資=應付工資 - 保險- 稅金
*/
struct employee{
string m_num;//編號
string m_name;//姓名
string m_dep;//部門
double m_salary;//應付工資
double m_insurance;//保險
double m_tax;//稅金
};

/*
(1)錄入:輸入職工數據,其中「實付工資」通過計算得到;
(2)刪除:刪除指定的職工信息(輸入姓名,若找到則刪除該信息)
(3) 修改:允許對已經錄入的數據重新進行編輯、修改;
(4) 顯示:顯示全體職工數據;
(5)查詢:
a. 輸入職工姓名,顯示該職工的全部數據;
b. 輸入某部門值,顯示該部門職工的數據、工資總額、平均工資。
(6) 退出程序。
*/

list<employee> emps;

int _tmain(int argc, _TCHAR* argv[])
{
void print(const employee &e);
void input();
void del();
void mod();
void show_all();
void show_name();
void show_dep();

cout<<"簡易職工薪水管理程序 by 做他\n";// delete this line
cout<<"版權沒有 請隨意復制或修改任何代碼\n";//delete this line

cout<<"請選擇操作:1.錄入 2.刪除 3.修改 4.查詢 5.顯示所有員工 6.退出 :";
int choose=0;
cin>>choose;
assert(!cin.fail());
while (choose!=6)
{
if (choose==1) input();
if (choose==2) del();
if (choose==3) mod();
if (choose==4)
{
int choice=0;
cout<<"請選擇操作 1.按姓名查詢 2.按部門查詢 3.退出:";
cin>>choice;
if (choice==1) show_name();
if (choice==2) show_dep();
if (choice==3)
{
cout<<"請選擇操作:1.錄入 2.刪除 3.修改 4.查詢 5.顯示所有員工 6.退出 :";
cin>>choose;
assert(!cin.fail());
continue;
}
}
if (choose==5) show_all();
cout<<"請選擇操作:1.錄入 2.刪除 3.修改 4.查詢 5.顯示所有員工 6.退出 :";
cin>>choose;
assert(!cin.fail());
}
return 0;
}

void print(const employee &e)
{
cout<<"編號:"<<e.m_num<<endl;
cout<<"姓名:"<<e.m_name<<endl;
cout<<"部門:"<<e.m_dep<<endl;
cout<<"保險:"<<e.m_insurance<<endl;
cout<<"稅金:"<<e.m_tax<<endl;
cout<<"應付工資:"<<e.m_salary<<endl;
cout<<"實付工資:"<<e.m_salary-e.m_insurance-e.m_tax<<endl;
}

void input()
{
string num,name,dep;
double salary,ins,tax;
cout<<"請輸入員工編號:";
cin>>num;
cout<<"請輸入員工姓名:";
cin>>name;
cout<<"請輸入員工部門:";
cin>>dep;
cout<<"請輸入員工保險:";
cin>>ins;
assert(!cin.fail());
cout<<"請輸入員工稅金:";
cin>>tax;
assert(!cin.fail());
cout<<"請輸入員工應付工資:";
cin>>salary;
assert(!cin.fail());
employee temp;
temp.m_dep=dep;
temp.m_insurance=ins;
temp.m_name=name;
temp.m_num=num;
temp.m_salary=salary;
temp.m_tax=tax;
emps.push_back(temp);
cout<<"員工錄入操作完畢.\n";
}

void del()
{
if (emps.size()==0)
{
cout<<"沒有員工記錄.\n";
return;
}
string name;
bool isfind=false;
cout<<"請輸入要刪除的員工姓名:";
cin>>name;
list<employee>::iterator iter;
for (iter=emps.begin();iter!=emps.end();iter++)
{
if (iter->m_name==name)
{
isfind=true;
emps.erase(iter);
cout<<"姓名為\""<<name<<"\"的員工記錄已刪除.\n";
return;
}
}
if (!isfind)
{
cout<<"沒有找到姓名為\""<<name<<"\"的員工.\n";
return;
}
}

void mod()
{
if (emps.size()==0)
{
cout<<"員工記錄為空.\n";
return;
}
bool isfind=false;
string name;
cout<<"請輸入要修改的員工姓名:";
cin>>name;
list<employee>::iterator iter;
for (iter=emps.begin();iter!=emps.end();iter++)
{
if (iter->m_name==name)
{
isfind=true;
cout<<"姓名為\""<<name<<"\"的員工記錄已找到.\n";
break;
}
}
if (isfind)
{
string num,name,dep;
double tax,ins,salary;
print(*iter);
cout<<endl;
cout<<"請輸入新的員工編號:";
cin>>num;
cout<<"請輸入新的員工姓名:";
cin>>name;
cout<<"請輸入新的員工部門:";
cin>>dep;
cout<<"請輸入新的員工保險:";
cin>>ins;
assert(!cin.fail());
cout<<"請輸入新的員工稅金:";
cin>>tax;
assert(!cin.fail());
cout<<"請輸入新的員工工資:";
cin>>salary;
assert(!cin.fail());
iter->m_dep=dep;
iter->m_insurance=ins;
iter->m_name=name;
iter->m_num=num;
iter->m_salary=salary;
iter->m_tax=tax;
cout<<"1 員工記錄被成功修改.\n";
}
else
{
cout<<"沒有找到姓名為\""<<name<<"\"的員工記錄.\n";
}
}

void show_all()
{
if (emps.size()==0)
{
cout<<"員工記錄為空.\n";
return;
}
cout<<"顯示全體員工數據:\n";
cout<<"--------------------\n";
list<employee>::iterator iter;
for(iter=emps.begin();iter!=emps.end();iter++)
{
cout<<endl;
print(*iter);
cout<<endl;
}
cout<<"--------------------\n";
}

void show_name()
{
if (emps.size()==0)
{
cout<<"員工記錄為空.\n";
return;
}
bool isfind=false;
string name;
cout<<"請輸入要查詢的員工姓名:";
cin>>name;
list<employee>::iterator iter;
for(iter=emps.begin();iter!=emps.end();iter++)
{
if (iter->m_name==name)
{
isfind=true;
cout<<"姓名為\""<<name<<"\"的員工記錄已找到.\n";
print(*iter);
break;
}
}
if (!isfind)
{
cout<<"沒有找到姓名為\""<<name<<"\"的員工.\n";
return;
}
}

void show_dep()
{
if (emps.size()==0)
{
cout<<"員工記錄為空.\n";
return;
}
double isfind=0.00;
double total_salary=0.00;
string dep;
cout<<"請輸入要查詢的部門名稱:";
cin>>dep;
cout<<"部門["<<dep<<"]的員工信息:\n";
cout<<"--------------------\n\n";
list<employee>::iterator iter;
for(iter=emps.begin();iter!=emps.end();iter++)
{
if (iter->m_dep==dep)
{
isfind++;
total_salary+=iter->m_salary;
print(*iter);
cout<<endl;
continue;
}
}
cout<<"--------------------\n";
if (isfind==0)
{
cout<<"沒有找到名稱為["<<dep<<"]的部門.\n";
}
else
{
cout<<"部門["<<dep<<"]工資統計:\n";
cout<<"工資總額:"<<total_salary<<endl;
cout<<"平均工資:"<<total_salary/isfind<<endl;
}
}

❾ 用C語言編寫計算工人工資

#include&amp;lt;stdio.h&amp;gt;
void main()
{
int hour;
int salary;
scanf("%d",hour);
switch(hour/60)
{
case 0:
{
salary=hour*84-700;
break;
}
case 1:
{
salary=hour*84;
break;
}
case 2:
{
salary=120*84+(hour-120)*(84*1.5);
break;
}
default:
printf("工時錯誤!");
}
printf("工資為%d",salary);
}

抱歉,好久沒弄C了,上面隨便寫沒編譯,剛才又弄了一下

#include<stdio.h>
void main()
{
int hour=0;
double salary;
scanf("%d",&hour);
while(hour<0)
{
printf("工時錯誤,重新輸入!");
scanf("%d",&hour);
}
switch(hour/60)
{
case 0:
{
salary=hour*84-700;
break;
}
case 1:
{
salary=hour*84;
break;
}
case 2:
{
salary=120*84+(hour-120)*(84*1.15);
break;
}
}
printf("工資為%f",salary);
}

❿ 用C語言編寫一個計算薪水的程序

/*工資計算程序*/
#include <stdio.h>

main()
{
float originWage; /*應發工資*/
float realWage; /*實發工資*/
float tax; /*所繳稅款*/
int i,hour,amount,money;

printf("請選擇工資種類:\n1.計時工資\n2.計件工資\n3.固定月工資\n");
scanf("%d",&i);
switch(i)
{
case 1:{
printf("請輸入工作時間(單位:小時)\n");
scanf("%d",&hour);
printf("請輸入單位時間的薪水(單位:元)\n");
scanf("%f",&money);
originWage=money*hour;
}
break;
case 2:{
printf("請輸入生產產品數量(單位:件)\n");
scanf("%d",&amount);
printf("請輸入生產一件產品的薪水(單位:元)\n");
scanf("%f",&money);
originWage=money*amount;
}
break;
case 3: printf("請輸入你的固定工資\n");
scanf("%f",&originWage);
break;
default:printf("輸入錯誤!\n");
return 0;
}

if(originWage<0)
{
printf("數據錯誤!\n");
return 0;
}
if(originWage<2000)
tax=0;
else if(originWage>2000&&originWage<=2500)
tax=(originWage-2000)*0.05;
else if(originWage>2500&&originWage<=4000)
tax=(originWage-2500)*0.1+500*0.05;
else
tax=(originWage-4000)*0.15+1500*0.1+500*0.05;
printf("應發工資: %f\n",originWage);
printf("所繳稅款: %f\n",tax);
printf("實發工資: %f\n",originWage-tax);
return 0;
}

熱點內容
小翼管家如何查看密碼 發布:2024-04-19 09:57:31 瀏覽:156
怎麼緩存小品 發布:2024-04-19 09:49:02 瀏覽:410
在系統編程 發布:2024-04-19 08:54:55 瀏覽:235
visualstudio反編譯 發布:2024-04-19 08:44:46 瀏覽:320
ise怎麼配置晶元 發布:2024-04-19 08:27:31 瀏覽:997
免費搭建在線查詢伺服器 發布:2024-04-19 08:17:28 瀏覽:46
vs資料庫實例 發布:2024-04-19 08:14:54 瀏覽:295
vfp9反編譯 發布:2024-04-19 08:11:31 瀏覽:381
火車軟卧無線密碼是多少 發布:2024-04-19 07:38:59 瀏覽:423
vb系統文件夾 發布:2024-04-19 07:29:58 瀏覽:740