编程菜鸟的日记-初学尝试编程-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 ...
随机推荐
- 新装的SSMS一打开就显示VS许可证过期,但VS又运行正常,解决方法。
1.出现问题如下图: 2.解决方法 打开控制面板->程序卸载->找到Microsoft Visual Studio *** Shell(****),右击-修复. 3.修复好了,然后重启电脑 ...
- PhpStorm常用快捷键以及如何连接外部服务器
PhpStorm常用快捷键以及如何连接外部服务器 PhpStorm作为我们phper使用的一款IDE,其功能是非常强大的,现在记录下常用的快捷键以及如何使用它与外部服务器进行连接使用. 一.Keyma ...
- 微信小程序出现 Expecting 'STRING','NUMBER','NULL','TRUE','FALSE','{','[', got INVALID
是因为,app.json中不能有注释,我将我上面注释的部分去掉,就可以了
- 97w网站邀请码
我是一个老粉丝了. 如果想要97w网站邀请码可以留下联系方式,给我发过去哦. 最好是邮箱. http://www.97w.net/tag.html
- 查询sql 索引
SELECT indexname = a.name , tablename = c. name , indexcolumns = d .name , a .indidFROM sysindexes a ...
- 7、字典和string的用法
#dic={1:'alex','age':35,'hobby':{'girl_name':'铁锤','age':45},'is_handsome':True} # dic={'age':'alex', ...
- Java并发编程之美之并发编程线程基础
什么是线程 进程是代码在数据集合上的一次运行活动,是系统进行资源分配和调度的基本单位,线程则是进程的一个执行路径,一个进程至少有一个线程,进程的多个线程共享进程的资源. java启动main函数其实就 ...
- 2018-2019-2 《网络对抗技术》 Exp0 Kali安装 20165221 Week1
2018-2019-2 <网络对抗技术> Exp0 Kali安装 20165221 Week1 安装Vmware 上学期已经安装过,不再赘述. 如需安装,可参考如何安装vmware 下载v ...
- TypeScript 错误property does not exist on type Object
TypeScript 错误property does not exist on type Object 在TypeScript中如果按JS的方式去获取对象属性,有时会提示形如Property 'val ...
- Python简单试题
1,相乘次数 题目要求描述: 一个整数每一位上的数字相乘,判断是否为个位数,若是则程序结束 ,不是则继续相乘,要求返回相乘次数. 例:39 > 3*9=27 > 2*7=14 > 1 ...