【郑轻】[1758]Stone scissors and cloth

这里写图片描述
这里写图片描述

让我想到了我的机器人~
哈哈哈
不过这个写的也是毫无亮点的麻烦……

#include<stdio.h>
int jd(int a,int b);
int main() {
    int a[3],x[3];
    int i,na,nx;
    while(scanf("%d %d %d %d %d %d",&a[0],&a[1],&a[2],&x[0],&x[1],&x[2])!=EOF) {
        for(i=0,na=0,nx=0; i<3; i++) {
            if(jd(a[i],x[i])==1)
                na++;
            if(jd(a[i],x[i])==2)
                nx++;
        }
        if(na>nx)
            printf("dml is the winner\n");
        else if(na<nx)
            printf("zy is the winner\n");
        else
            printf("no winner\n");
    }
    return 0;
}
int jd(int a,int b) {
    if(a==1&&b==3)
        return 2;
    else if(a==3&&b==1)
        return 1;
    else if(a<b)
        return 1;
    else if(a>b)
        return 2;
    else
        return 0;
}

题目地址:【郑轻】[1758]Stone scissors and cloth

原文地址:https://www.cnblogs.com/BoilTask/p/12570032.html