• BNUOJ 6038


      这是一个水模拟,但是因为图片看不清,手打比较烧脑,我们错了好多次才过

    #include<stdio.h>
    #include<iostream>
    #include<string.h>
    #include<queue>
    #include<algorithm>
    using namespace std;
    ///0 Pock 1 Dcissors 2 Paper
    int Judge(char *a,char *b)
    {
        if(!strcmp(a,"cs"))
        {
            if(!strcmp(b,"Kamen")) return 0;
            if(!strcmp(b,"Nuzky")) return 1;
            if(!strcmp(b,"Papir")) return 2;
        }
        if(!strcmp(a,"en"))
        {
            if(!strcmp(b,"Rock")) return 0;
            if(!strcmp(b,"Scissors")) return 1;
            if(!strcmp(b,"Paper")) return 2;
        }
        if(!strcmp(a,"fr"))
        {
            if(!strcmp(b,"Pierre")) return 0;
            if(!strcmp(b,"Ciseaux")) return 1;
            if(!strcmp(b,"Feuille")) return 2;
        }
        if(!strcmp(a,"de"))
        {
            if(!strcmp(b,"Stein")) return 0;
            if(!strcmp(b,"Schere")) return 1;
            if(!strcmp(b,"Papier")) return 2;
        }
        if(!strcmp(a,"hu"))
        {
            if(!strcmp(b,"Ko") || !strcmp(b,"Koe")) return 0;
            if(!strcmp(b,"Ollo") || !strcmp(b,"Olloo")) return 1;
            if(!strcmp(b,"Papir")) return 2;
        }
        if(!strcmp(a,"it"))
        {
            if(!strcmp(b,"Sasso") || !strcmp(b,"Roccia")) return 0;
            if(!strcmp(b,"Forbice")) return 1;
            if(!strcmp(b,"Carta") || !strcmp(b,"Rete")) return 2;
        }
        if(!strcmp(a,"jp"))
        {
            if(!strcmp(b,"Guu")) return 0;
            if(!strcmp(b,"Choki")) return 1;
            if(!strcmp(b,"Paa")) return 2;
        }
        if(!strcmp(a,"pl"))
        {
            if(!strcmp(b,"Kamien")) return 0;
            if(!strcmp(b,"Nozyce")) return 1;
            if(!strcmp(b,"Papier")) return 2;
        }
        if(!strcmp(a,"es"))
        {
            if(!strcmp(b,"Piedra")) return 0;
            if(!strcmp(b,"Tijera")) return 1;
            if(!strcmp(b,"Papel")) return 2;
        }
    }
    int main()
    {
        char cou1[200],cou2[200],p1[200],p2[200];
        bool flag = true;
        int ca = 0;
        while(~scanf("%s%s%s%s",cou1,p1,cou2,p2))
        {
            char op1[200],op2[200];
            int tot1 = 0,tot2 = 0;
            while(~scanf("%s",op1))
            {
                if(op1[0] == '-' || op1[0] == '.')
                {
                    printf("Game #%d:
    ",++ca);
                    if(tot1 == 1)
                    printf("%s: %d point
    ",p1,tot1);
                    else printf("%s: %d points
    ",p1,tot1);
                    if(tot2 == 1)
                    printf("%s: %d point
    ",p2,tot2);
                    else printf("%s: %d points
    ",p2,tot2);
                    if(tot1 > tot2) printf("WINNER: %s
    ",p1);
                    else if(tot1 < tot2) printf("WINNER: %s
    ",p2);
                    else puts("TIED GAME");
                    puts("");
                    if(op1[0] == '.')flag = false;
                    break;
                }
                scanf("%s",op2);
                int re1 = Judge(cou1,op1);
                int re2 = Judge(cou2,op2);
               /// cout<<"re1 = "<<re1<<endl;
               /// cout<<"re2 = "<<re2<<endl;
                if(re1 == re2) continue;
                if(re1 == 0 && re2 == 1) tot1++;
                else if(re1 == 1 && re2 == 2) tot1++;
                else if(re1 == 2 && re2 == 0) tot1++;
                else tot2++;
            }
            if(!flag) break;
        }
        return 0;
    }
  • 相关阅读:
    Ubuntu18.04下使用pip3.8报错subprocess.CalledProcessError: Command ‘(‘lsb_release‘, ‘-a‘)‘ returned non-ze
    解决报错:ModuleNotFoundError: No module named ‘_sqlite3‘
    shell命令中find的用法
    Ubuntu 中卸载软件
    git使用
    django celery 使用
    Django 学习中遇到的问题
    1
    Mac 下安装brew(文末方法亲测有效)
    经典类与新式类的继承顺序
  • 原文地址:https://www.cnblogs.com/jifahu/p/5452424.html
Copyright © 2020-2023  润新知