1.
#include<cstdio> int main(){ int k; char t; int sum=0; while(scanf("%d %c",&k,&t)!=EOF){ sum=0; if(k<=1000) sum+=8; if(k>1000) { int temp=k-1000; int a; if(k%500==0)a=temp/500; else a =temp/500+1; sum=8+a*4; } if(t==‘y‘) sum+=5; printf("%d",sum); } return 0; }
时间: 2024-10-25 23:37:57