首页 > 代码库 > HDU 4931 Happy Three Friends

HDU 4931 Happy Three Friends

#include <cstdio>#include <algorithm>using namespace std;int p1,p2,a[6],T;int main(){    scanf("%d",&T);    while(T--){        for(int i=0;i<6;i++)scanf("%d",&a[i]);        sort(a,a+6);        p1=a[4]+a[5];        p2=a[2]+a[3]+a[1];        if(p1>p2)puts("Grandpa Shawn is the Winner!");        else puts("What a sad story!");    }    return 0;}