zoukankan      html  css  js  c++  java
  • 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;
    }
  • 相关阅读:
    解决linux下fflush(stdin)无效
    《转载》使用Chrome浏览器截取整个网页
    JDK切换版本
    消息队列函数(msgget、msgctl、msgsnd、msgrcv)及其范例
    Oracle 账户
    Oracle linux 安装 相关
    Android高德地图获取当前缩放等级及可视区域四个角的坐标
    Intellij idea 导入项目之后编译错误:无效的源版本:7
    数据库异常整理:org.hibernate.QueryException: could not resolve property: “mStation”
    MySQL(六)多表查询
  • 原文地址:https://www.cnblogs.com/jifahu/p/5452424.html
Copyright © 2011-2022 走看看