提交时间:2025-11-02 13:44:24

运行 ID: 72662

#include<bits/stdc++.h> using namespace std; int main() { int weight,fee; char a; cin>>weight>>a; bool whether=(a=='y'); if(weight<=1000) { fee=8; } else if(weight>1000) { int k=weight-1000; if(k%500==0) { k=k/500; } else { k=k/500+1; } fee=8+k*4; } if(whether) { fee=fee+5; } cout<<fee; return 0; }