比赛 |
EYOI与SBOI开学欢乐赛2nd |
评测结果 |
RRRRR |
题目名称 |
个人所得税 |
最终得分 |
0 |
用户昵称 |
JasonW6 |
运行时间 |
0.002 s |
代码语言 |
C++ |
内存使用 |
5.74 MiB |
提交时间 |
2022-09-02 21:01:49 |
显示代码纯文本
#include<bits/stdc++.h>
using namespace std;
int m,p;
double ans,n1,n2;
char c1[10],c2[10];
void clenc(){
c1[0]=0,c1[1]=0,c1[2]=0,c1[3]=0,c1[4]=0,c1[5]=0,c1[6]=0,c1[7]=0,c1[8]=0,c1[9]=0;
}
int main(){
// freopen("personaltax.in","r",stdin);
// freopen("personaltax.out","w",stdout);
cin>>m;
while(cin>>c1){
cin>>c2,cin>>c2;
cin>>n1;
if(c1[0]=='P'&&c1[1]=='A'&&c1[2]=='Y') {
if(n1<=800) continue;
n1-=800;
if(n1<=500){
ans+=n1*0.05;
continue;
}
if(n1>500){
ans+=500*0.05;
}
if(n1<=2000){
ans+=(n1-500)*0.1;
continue;
}
if(n1>2000){
ans+=1500*0.1;
}
if(n1<=5000){
ans+=(n1-2000)*0.15;
continue;
}
if(n1>5000){
ans+=3000*0.15;
}
if(n1<=20000){
ans+=(n1-5000)*0.2;
continue;
}
if(n1>20000){
ans+=15000*0.2;
}
if(n1<=40000){
ans+=(n1-20000)*0.25;
continue;
}
if(n1>40000){
ans+=20000*0.25;
}
if(n1<=60000){
ans+=(n1-40000)*0.3;
continue;
}
if(n1>60000){
ans+=20000*0.3;
}
if(n1<=80000){
ans+=(n1-60000)*0.35;
continue;
}
if(n1>80000){
ans+=20000*0.35;
}
if(n1<=100000){
ans+=(n1-80000)*0.4;
continue;
}
if(n1>100000){
ans+=20000*0.4;
ans+=(n1-100000)*0.45;
continue;
}
}
if(c1[0]=='I'&&c1[1]=='N'&&c1[2]=='C'&&c1[3]=='O'&&c1[4]=='M'&&c1[5]=='E'){
if(n1<=800) continue;
if(n1<=4000) n1-=800;
else n1=n1-n1*0.2;
if(n1<=20000) {
ans+=n1*0.2;
continue;
}
if(n1>20000) ans+=20000*0.2;
if(n1<=50000) {
ans+=(n1-20000)*0.3;
continue;
}
if(n1>50000) ans+=(n1-50000)*0.4;
}
clenc();
}
cout<<ans;
return 0;
}