一.个人所得税计算器
#include <iostream.h>
#include<math.h>
void main( )
{
double dsalary,dtax=0,dnetincome=0;
cout<<"请输入您本月的收入总额(元):";
cin>>dsalary;
int A;
A=dsalary-3500;
if(A<=1500)
{
dtax=A*0.03;
}
else if(A>1500&&A<=4500)
{
dtax=A*0.1-105;
}
else if(A>4500&&A<=9000)
{
dtax=A*0.2-555;
}
else if(A>9000&&A<=35000)
{
dtax=A*0.25-1005;
cout<<dtax;
}
else if(A>35000&&A<=55000)
{
dtax=A*0.3-2755;
}
else if(A>55000&&A<=80000)
{
dtax=A*0.35-5505;
}
else
{
dtax=A*0.45-13505;
}
dnetincome=dsalary-dtax;
cout<<"您本月应缴个人所得税 "<<dtax<<" 元,税后收入是 "<<dnetincome<<" 元。\n";
cout<<"依法纳税,共享繁荣。谢谢使用!\n";
}
#include <iostream.h>
#include <math.h>
void main( )
{
int year,month,day;
cout<<"请输入年和月:";
cin>>year>>month;
if(month==1)
day=31;
else if(month==2)
if(year%4==0&&year%100!=0||year%400==0)
day=29;
else
day=28;
else if(month==3)
day=31;
else if(month==4)
day=30;
else if(month==5)
day=31;
else if(month==6)
day=30;
else if(month==7)
day=31;
else if(month==8)
day=31;
else if(month==9)
day=30;
else if(month==10)
day=31;
else if(month==11)
day=30;
else if(month==12)
day=31;
cout<<"天数是:"<<day<<endl;
}
#include <iostream.h>
#include <math.h>
void main()
{
int a,m,e;
double b,c;
cout<<"欢迎使用利息计算器!"<<endl;
cout<<"请输入存款金额:"<<endl;
cin>>m;
cout<<"======存款期限 ======"<<endl;
cout<<"1. 3个月"<<'\n'<<"2. 6个月"<<'\n'<<"3. 一年 "<<'\n'<<"4. 两年"<<'\n'<<"5. 三年"<<'\n'<<"6. 五年"<<endl;
cout<<"请输入存款期限的代号:"<<endl;
cin>>e;
switch(e)
{case 1:c=m*0.031*0.25;break;
case 2:c=m*0.033*0.5;break;
case 3:c=m*0.035*1;break;
case 4:c=m*0.044*2;break;
case 5:c=m*0.05*3;break;
case 6:c=m*0.055*5;break;
}
b=m+c;
cout<<"到期的利息为:"<<c;
cout<<"本息合计为:"<<b<<endl;
}