编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习5
#include <iostream>
using namespace std;
const double N1=35000;
const int N2=15000;
const int N3=5000;
int main()
{
double salary;
double sui=0;
cout<<"Enter the salary: ";
while(cin>>salary && salary>=0)
{
if(salary<=N3)
{
sui=0;
//cout<<"税收= "<<sui<<endl;
}
else if(salary>N3 && salary<=N2)
{
sui=(salary-N3)*0.10+N3*0;
//cout<<"税收= "<<sui<<endl;
}
else if(salary>N2 && salary<=N1)
{
sui=(salary-N2)*0.15+(N2-N3)*0.10+N3*0;
//cout<<"税收= "<<sui<<endl;
}
else
{
sui=(salary-N1)*0.20+(N1-N2)*0.15+(N2-N3)*0.10+N3*0;
//cout<<"税收= "<<sui<<endl;
}
cout<<"sui= "<<sui<<endl;
cout<<"Enter the salary: ";
}
system("pause");
return 0;
}
编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习5的更多相关文章
- 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习9
#include <iostream> #include <fstream> #include <cstdlib> #include <string> ...
- 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习8
#include <iostream> #include <fstream> #include <cstdlib> const int SIZE=20; using ...
- 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习7
#include <iostream> #include <string> #include <cctype> using namespace std; int m ...
- 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习6
#include <iostream> #include <string> using namespace std; const int MSIZE=100; struct j ...
- 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习4
#include <iostream> using namespace std; const int strsize=30; const int BOPSIZE=5; void showm ...
- 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习3
#include <iostream> using namespace std; void showmenu(void) { cout<<"Please enter ...
- 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习2
#include <iostream> #include <cctype> using namespace std; const int MAXSIZE=10; int mai ...
- 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习1
#include <iostream>#include <cctype>using namespace std;int main(){ char ch; while((ch=c ...
- 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第5章编程练习9
#include <iostream>using namespace std;int main(){ int num; cout<<"Enter number of ...
随机推荐
- es6中的class的使用
---恢复内容开始--- es5中生成实例对象的传统方法是通过构造函数: function Point(x,y){ this.x = x; this.y = y; } Point.prototype. ...
- python 中获取列表的索引
1.index方法 list_a= [12,213,22,2,32]for a in list_a: print(list_a.index(a)) 结果: 0 1 2 3 4 如果列表的没有重复的话那 ...
- apt-get install 出问题怎么办?
有时候在用apt-get安装包的时候总是会莫名其妙出现各种问题,建议先把如下命令行按顺序敲一遍,基本上都能解决 sudo apt-get clean sudo apt-get update sudo ...
- Win10如何彻底禁用小娜?彻底禁用小娜的方法
原文地址:https://www.cnblogs.com/zhuimengle/p/5949152.html 小娜是Win10系统中的一款强大功能,有了它,我们对电脑的操作将更加方便.Win10系统有 ...
- expect 批量自动部署ssh 免密登陆 之 二
#!/usr/bin/expect -f ########################################## hutu #Push the id.pas.pub public key ...
- char *p[] 和char**的思考
char *p[] = {"hello","world"}; char **pp; pp = p; printf("%s,%s\n",*pp ...
- 提示缺少tns_admin的解决办法
问题:安装ZL数据安全辅助工具后,执行时出现 “未设置系统环境变量tns_admin!” 解决: 1.查找tnsnames.ora所在目录,比如这里的目录为:C:\app\H\product\11.2 ...
- 那什么时候会触发BFC呢?块级格式化上下文
<html>根元素: float的值不为none: overflow的值为auto.scroll或hidden: display的值为table-cell.table-caption和in ...
- Day06(类包、内部类)
在static静态方法中能直接调用的方法只能是静态方法.要想调用其它非静态方法,需要借助对象. 类包:是Java提供的一种管理类文件的机制.可以解决类名冲突问题,在开发庞大应用程序时帮助开发人员管理庞 ...
- ef core自动映射
原回答:https://stackoverflow.com/questions/26957519/ef-core-mapping-entitytypeconfiguration 一.反射 protec ...