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");



}

原文地址:https://www.cnblogs.com/qq84435/p/3664837.html