2022年深圳市个人所得税计算程序C++源码
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
using namespace std;
class Employee {
private:
string name;
double salary;
public:
Employee(string name, double salary) {
this->name = name;
this->salary = salary;
}
string getName() { return name; }
double getSalary() { return salary; }
};
bool cmp(Employee& e1, Employee& e2) { return e1.getSalary() > e2.getSalary(); }
void print(Employee& e) {
double tax = 0.0;
double t = e.getSalary() - 5000;
if (t <= 0) {}
else if (t > 0 && t <= 5000) { tax = t * 0.05 - 0; }
else if (t > 5000 && t <= 10000) { tax = t * 0.10 - 250; }
else if (t > 10000 && t <= 30000) { tax = t * 0.20 - 1250; }
else if (t > 30000 && t <= 50000) { tax