📄 1057.cpp
字号:
/* This Code is Submitted by wywcgs for Problem 1057 on 2005-03-11 at 23:09:02 */
#include <stdio.h>
int main()
{
int total, mileage, i;
char type, ch[20];
while(1){
total = 0;
for(i = 0; i < 20; i++){
ch[i] = '\0';
}
while(scanf("%s", ch) == 1){
if(ch[0] == '0'){
break;
}else if(ch[0] == '#'){
return 0;
}
scanf("%*s %d %c", &mileage, &type);
switch(type){
case 'F':
total += mileage * 2;
break;
case 'B':
if(mileage % 2 == 0){
total += mileage * 3 / 2;
}else{
total += (mileage+1) * 3 / 2 - 1;
}
break;
case 'Y' :
if(mileage <= 500){
total += 500;
}else{
total += mileage;
}
break;
default :
break;
}
}
printf("%d\n", total);
}
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -