标签:matlab 需要 turn 问题 比较 printf std nbsp 包含
1 #include<stdio.h> 2 int main(){ 3 float x1, x2, x3, x4, x5, x6, x7; 4 x1 = 3500 * 0.03; 5 x2 = -1500 * 0.03 + 5000 * 0.1; 6 x3 = -1500 * 0.03 - 3000 * 0.1 + 8000 * 0.2; 7 x4 = -1500 * 0.03 - 3000 * 0.1 - 4500 * 0.2 + 12500 * 0.25; 8 x5 = -1500 * 0.03 - 3000 * 0.1 - 4500 * 0.2 - 26000 * 0.25 + 38500 * 0.3; 9 x6 = -1500 * 0.03 - 3000 * 0.1 - 4500 * 0.2 - 26000 * 0.25 - 20000 * 0.3 + 58500 * 0.35; 10 x7 = -1500 * 0.03 - 3000 * 0.1 - 4500 * 0.2 - 26000 * 0.25 - 20000 * 0.3 - 25000 * 0.35 + 83500 * 0.45; 11 int y,x; 12 float s, t; 13 scanf("%d", &y); 14 t = (float)y; 15 if (t <= 3500) 16 s = t; 17 else if (t <= 4955) 18 s = (t - x1) / 0.97; 19 else if (t <= 7655) 20 s = (t - x2) / 0.9; 21 else if (t <= 11255) 22 s = (t - x3) / 0.8; 23 else if (t <= 30755) 24 s = (t - x4) / 0.75; 25 else if (t <= 43755) 26 s = (t - x5) / 0.7; 27 else if (t <= 61005) 28 s = (t - x6) / 0.65; 29 else 30 s = (t - x7) / 0.55; 31 x = (int)s; 32 printf("%d\n", x); 33 return 0; 34 }
做题感悟:虽然简单,但是需要细心,因为划定税后的工资范围需要进行计算而不能直接使用税前工资的范围。
标签:matlab 需要 turn 问题 比较 printf std nbsp 包含
原文地址:http://www.cnblogs.com/langzi1996/p/6649233.html