#include #include #include #include using namespace std; ifstream f("date.in"); #define f cin #define INF 0x3f3f3f3f int table[10][10]; double percent[10]; void init() { table[1][1] = 9075; table[1][2] = 36900; table[1][3] = 89350; table[1][4] = 186350; table[1][5] = 405100; table[1][6] = 406750; table[1][7] = INF; table[2][1] = 18150; table[2][2] = 73800; table[2][3] = 148850; table[2][4] = 226850; table[2][5] = 405100; table[2][6] = 457600; table[2][7] = INF; table[3][1] = 12950; table[3][2] = 49400; table[3][3] = 127550; table[3][4] = 206600; table[3][5] = 405100; table[3][6] = 432200; table[3][7] = INF; table[4][1] = 9075; table[4][2] = 36900; table[4][3] = 74425; table[4][4] = 113425; table[4][5] = 202550; table[4][6] = 228800; table[4][7] = INF; percent[0] = 10.0; percent[1] = 15.0; percent[2] = 25.0; percent[3] = 28.0; percent[4] = 33.0; percent[5] = 35.0; percent[6] = 39.6; } int main() { init(); int line = 0; string s; getline(f, s); int income; f >> income; if (s == "Single") line = 1; if (s == "Married joint filers") line = 2; if (s == "Surviving spouse") line = 2; if (s == "Heads of household") line = 3; if (s == "Married filing separately") line = 4; int i; for (i = 0; i < 7; i++) { if (table[line][i] < income && income <= table[line][i + 1]) { break; } } cout << (int)(income * percent[i] / 100); return 0; }