Advanced 1011 World Cup Betting(20分)

PAT题目链接

#include 
const char no[3]={'W','T','L'};
int main() {
    float line_max,res=1.0f,curr;
    int max_no[3];
    for (int j = 0; j < 3; ++j) {
        line_max=-1.0f;
        for(int i=0;i<3;i++){
            scanf("%f",&curr);
            if(curr>line_max){
                line_max=curr;
                max_no[j]=i;
            }
        }
        res*=line_max;
    }
    printf("%c %c %c ",no[max_no[0]],no[max_no[1]],no[max_no[2]]);
    printf("%.2f\n",(res*0.65f-1.0f)*2.0f);
    return 0;
}

你可能感兴趣的:(Advanced 1011 World Cup Betting(20分))