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

B1046 划拳

时间:2017-08-04 22:48:12      阅读:236      评论:0      收藏:0      [点我收藏+]

标签:用例   class   turn   return   nbsp   std   实现   print   count   

//进行下一轮(同输赢怎么实现)?
//多组测试用例的时候,其实,一个一个的测试运行,细细体会!!!

#include<stdio.h>

int main()
{
    int n;
    scanf("%d",&n);
    int count1=0;
    int count2=0;
    
    while(n--)
    {
        int a1,b1,a2,b2;
        scanf("%d%d%d%d",&a1,&b1,&a2,&b2);
        
        if(b1==a1+a2&&b2!=a1+a2)
            count2++;
        if(b1!=a1+a2&&b2==a1+a2)
            count1++;
        
        if((b1==a1+a2&&b2==a1+a2)||(b1!=a1+a2&&b2!=a1+a2))
            continue;
    }
    printf("%d %d\n",count1,count2);
    return 0;
}

 

B1046 划拳

标签:用例   class   turn   return   nbsp   std   实现   print   count   

原文地址:http://www.cnblogs.com/dusanlang/p/7287152.html

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