#include<bits/stdc++.h> using namespace std; double T[10]={0,45,345,1245,7745,13745,22495}; double r[10]={3500,5000,8000,12500,38500,58500,83500}; double s[10]={0.03,0.1,0.2,0.25,0.3,0.35,0.45}; int main(){ int t;cin>>t; double result; bool flag=true; for(int i=1;i<=6;i++){ if(t<=3500){ flag=false; result=t; break; } if(t<=r[i]-T[i]){ result=(t-s[i-1]*r[i-1]+T[i-1])/(1-s[i-1]); flag=false; break; } } if(flag){ result=(t-s[6]*r[6]+T[6])/(1-s[6]); } cout<<result; }
标签:10,int,double,0.3,0.1,csp201612 From: https://www.cnblogs.com/yds0823/p/17209761.html