当前位置:   article > 正文

任务8_semeval-2010 task 8数据集

semeval-2010 task 8数据集
  1. include <stdio.h>
  2. #include <stdlib.h>
  3. typedef struct stu
  4. {
  5. char xm[10];
  6. int bh;
  7. float gz;
  8. } xx;
  9. xx shuru(xx *wage,int n)
  10. {
  11. int i;
  12. for(i=0;i<n;i++)
  13. {
  14. scanf("%s",&wage[i].xm);
  15. scanf("%d",&wage[i].bh);
  16. scanf("%f",&wage[i].gz);
  17. }
  18. }
  19. float jiaoshui(float q,int n)
  20. {
  21. int i,m;
  22. float js;
  23. q=q-3500;
  24. for(i=0;i<n;i++)
  25. {
  26. if(q<=0)
  27. m=1;
  28. else if(q<=1500&&q>0)
  29. m=2;
  30. else if(q<=4500&&q>1500)
  31. m=3;
  32. else if(q<=9000&&q>4500)
  33. m=4;
  34. else if(q<=35000&&q>9000)
  35. m=5;
  36. else if(q<=55000&&q>35000)
  37. m=6;
  38. else if(q<=80000&&q>55000)
  39. m=7;
  40. else m=8;
  41. }
  42. switch(m)
  43. {
  44. case 1:
  45. js=0;
  46. break;
  47. case 2:
  48. js=q*0.03;
  49. break;
  50. case 3:
  51. js=q*0.1-105;
  52. break;
  53. case 4:
  54. js=q*0.2-555;
  55. break;
  56. case 5:
  57. js=q*0.25-1005;
  58. break;
  59. case 6:
  60. js=q*0.3-2755;
  61. break;
  62. case 7:
  63. js=q*0.35-5505;
  64. break;
  65. case 8:
  66. js=q*0.45-13505;
  67. }
  68. return js;
  69. }
  70. int main()
  71. {
  72. int n,k;
  73. float q,js,sh;
  74. xx *wage;
  75. while(1)
  76. {
  77. printf("请输入员工人数:\n");
  78. scanf("%d",&n);
  79. wage=(int *)malloc(n*sizeof(int));
  80. printf("请输入姓名,编号,工资:\n");
  81. shuru(wage,n);
  82. for(k=0;k<n;k++)
  83. {
  84. q=wage[k].gz;
  85. js=jiaoshui(q,n);
  86. sh=q-js;
  87. printf("姓名:%s 编号:%d 交税:%f 税后工资:%f\n",wage[k].xm,wage[k].bh,js,sh);
  88. }
  89. }
  90. return 0;
  91. }

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/花生_TL007/article/detail/543295
推荐阅读
相关标签
  

闽ICP备14008679号