码迷,mamicode.com
首页 > 其他好文 > 详细

csu 1577: Dice Game

时间:2015-04-26 18:21:09      阅读:124      评论:0      收藏:0      [点我收藏+]

标签:c

#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; 
} 

csu 1577: Dice Game

标签:c

原文地址:http://blog.csdn.net/xky1306102chenhong/article/details/45290389

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!