PAT甲题题解-1011. World Cup Betting (20)-误导人的水题。。。

题目不严谨啊啊啊啊
式子算出来结果是37.975
样例输出的是37.98
我以为是四舍五入的啊啊啊,所以最后输出的是sum+0.005
结果告诉我全部错误啊
结果直接保留两位小数就可以了啊啊啊啊

水题也不要这么坑人啊啊啊啊

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>

using namespace std;
int main()
{
    double a[3];
    double sum=1.0;
    for(int i=0;i<3;i++){
        scanf("%lf %lf %lf",&a[0],&a[1],&a[2]);
//printf("%lf %lf %lf\n",a[0],a[1],a[2]);
        if(a[0]>=a[1] && a[0]>=a[2]){
            printf("W ");
            sum*=a[0];
        }
        else if(a[1]>=a[0] && a[1]>=a[2]){
            printf("T ");
            sum*=a[1];
        }
        else{
            printf("L ");
            sum*=a[2];
        }
    }
    sum=(sum*0.65-1)*2;
    printf("%.2lf\n",sum);
    return 0;
}

时间: 2024-11-06 06:00:46

PAT甲题题解-1011. World Cup Betting (20)-误导人的水题。。。的相关文章

PAT (Advanced Level) Practice 1011 World Cup Betting (20 分)

With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excited as the best players from the best teams doing battles for the World Cup trophy in South Africa. Similarly, football betting fans were putting their

1011. World Cup Betting (20)——PAT (Advanced Level) Practise

题目信息: 1011. World Cup Betting (20) 时间限制 400 ms 内存限制 32000 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excited as the best players from the best teams doing

Programming Ability Test学习 1011. World Cup Betting (20)

1011. World Cup Betting (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excited as the best players from the best teams doing battl

PATA 1011 World Cup Betting (20)

1011. World Cup Betting (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excited as the best players from the best teams doing battl

1011. World Cup Betting (20)

1011. World Cup Betting (20) With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excited as the best players from the best teams doing battles for the World Cup trophy in South Africa. Similarly, football bet

PAT (Advanced Level) 1011. World Cup Betting (20)

简单题. #include<iostream> #include<cstring> #include<cmath> #include<algorithm> #include<cstdio> using namespace std; double a[5][5],Max[5]; double ans=1; int main() { for(int i=1;i<=3;i++) for(int j=1;j<=3;j++) scanf(&qu

PAT甲题题解-1005. Spell It Right (20)-数位求和,水

把每个位上的数字求和sum,然后以英文单词的形式输出sum的每个位 #include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <vector> using namespace std; /* 把每个位上的数字求和sum,然后以英文单词的形式输出sum的每个位 水 */ char word[10][20]={"zero&qu

1011. World Cup Betting (20)(最大值)

With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excited as the best players from the best teams doing battles for the World Cup trophy in South Africa. Similarly, football betting fans were putting their

1011 World Cup Betting (20)(20 分)

#include<stdio.h> #include<stdbool.h> #include<stdlib.h> #include<string.h> int main(int argc,char const *argv[]){ char s[]={'W','T','L'}; double ans=1.0,tmp,a; int i,j,idx; for(i=0;i<3;i++ ){ tmp=0.0; for(j=0;j<3;j++){ scanf