csu 1577: Dice Game

#include <cstdio> 
#include <iostream> 
#include <algorithm> 
using namespace std; 
  
double sumg,sume; 
int ga1,gb1,ga2,gb2,ea1,eb1,ea2,eb2; 
  
int main () 
{ 
    while (scanf("%d%d%d%d",&ga1,&gb1,&ga2,&gb2)!=EOF) 
    { 
        sumg = (double)(ga1+gb1)/2+(double)(ga2+gb2)/2; 
        scanf ("%d%d%d%d",&ea1,&eb1,&ea2,&eb2); 
        sume = (double)(ea1+eb1)/2+(double)(ea2+eb2)/2; 
        if (sumg > sume) 
        printf ("Gunnar\n"); 
        else if (sumg < sume) 
        printf ("Emma\n"); 
        else
        printf ("Tie\n"); 
    } 
    return 0; 
} 

你可能感兴趣的:(c)