poj 1326(水题)

#include<iostream>
#include<cmath>
#include<cstring>
using namespace std;
int main(){
    int sum,mile;
    char a[2][20],icon[2];
    while(true){
        sum = 0;
        while(true){
            scanf("%s",a[0]);
            if(strcmp(a[0],"#")==0)return 1;
            if(strcmp(a[0],"0")==0)break;
            scanf("%s%d%s",a[1],&mile,icon);
            if(strcmp(icon,"F")==0){
                sum += mile*2;
            }
            if(strcmp(icon,"B")==0){
                sum += ceil(mile*1.5);
            }
            if(strcmp(icon,"Y")==0){
                if(mile<=500){
                    sum += 500;
                }
                else{
                    sum += mile;
                }
            }
        }
        printf("%d\n",sum);
    }
    return 0;
}

 

上一篇:解决QIcon引用qrc不显示图片


下一篇:Vue电商项目练习-3 主页设计