编程菜鸟的日记-初学尝试编程-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 ...
随机推荐
- windows系统安装gcc编译器----c/c++语言编译器
1.安装MinGW编译管理安装软件 官方下载:https://osdn.net/projects/mingw/releases/ 作者百度云备份下载:https://pan.baidu.com/s/1 ...
- proxysql系列 ~ 运维相关
一 常用命令 //实时加载 load mysql servers to runtime; mysql_server load mysql users to runtime; mysql_u ...
- hibernate原生sql获取list<T>异常解决
/** * <p>Title: getbigestMinIntegral</p> * <p>Description: 获取最大的MinIntegral(原则上即最高 ...
- 按Ctrl+Enter发送的实现
按Ctrl+Enter发送 1, 监听textarea的onkeydown事件 <textarea tabindex="1" class="ie6ta" ...
- 关于shell变量的继承总结
结论: 默认,父shell和子shell的变量是隔离的. sh方式运行脚本,会重新开启一个子shell,无法继承父进程的普通变量,能继承父进程export的全局变量. source或者. 方式运行脚本 ...
- computed计算属性
在computed中,可以定义一些属性,这些属性 叫做计算属性.计算属性的本质是一个方法,只不过我们在使用的时候,把他们的名称当做属性来使用,并不会吧计算属性当做方法去调用.与methods平级. / ...
- jsp多模块相同数据提交到后台之数据处理
最近在写一个java多模块表单提交,起初想的只是一个简单的form表单提交,写的时候发现不是真简单.多个相同类型数据提交到后台接收的问题很困难. 于是,和人进行深入的讨论,感觉j以json的格式提交时 ...
- SQL语句:子查询
一,子查询定义: 子查询就是嵌套在主查询中的查询. 子查询可以嵌套在主查询中所有位置,包括SELECT.FROM.WHERE.GROUP BY.HAVING.ORDER BY. 但并不是每个位置嵌套子 ...
- ssh登录,爬坑系列
最近在实验室弄ssh登录,结果被虐了,要注意以下: 1.主机名不能包括 - _ ! 等非法字符. 2.如果hadoop格式化时,报:“SHUTDOWN_MSG: Shutting ...
- 键盘keyCode值
参考地址: https://blog.csdn.net/qq_25835645/article/details/78788987