C++primer plus第六版课后编程题答案 6.5

//6.5
#include <iostream>
#include<cctype>
using namespace std;

void main65()
{
	int salary;
	cout<<"Enter your salary:";
	cin>>salary;
	while(salary>=0)//&&isdigit(salary))
	{
		if(salary<5000)
			cout<<"Your salary is "<<salary<<"  You shouldn't!"<<endl;
		else if(salary<15000)
			cout<<"Your salary is "<<salary<<" ,Your sui is "<<salary*0.1<<endl;
		else if(salary<35000)
			cout<<"Your salary is "<<salary<<" ,Your sui is "<<salary*0.15<<endl;
		else
			cout<<"Your salary is "<<salary<<" ,Your sui is "<<salary*0.2<<endl;

		cout<<"Enter your salary:";
		cin>>salary;
	}

	//cout<<salary<<"  isdigit()"<<endl;//<<isdigit(salary)<<endl;
	cout<<"Finish!";

	cin.get();
	system("pause");



}

posted @ 2014-03-31 13:41  天下纵横C++  阅读(142)  评论(0编辑  收藏  举报