首页 > 代码库 > XTU—1190 Game of Wuxing
XTU—1190 Game of Wuxing
纯模拟
http://202.197.224.59/OnlineJudge2/index.php/Problem/read/id/1190
#include<cstdio> int main() { //freopen("in.txt","r",stdin); int k,i,a,b,sum1,sum2; char x,y; scanf("%d",&k); getchar(); while(k--) { sum1=sum2=0; for(i=1;i<=5;i++) { scanf("%c%d",&x,&a); //printf("%c%d",x,a); getchar(); scanf("%c%d",&y,&b); //printf("%c%d",y,b); if(x==y) { sum1+=a; sum2+=b; } else if((x=='J'&&y=='T')||(x=='S'&&y=='J')||(x=='M'&&y=='S')||(x=='H'&&y=='M')||(x=='T'&&y=='H')) sum1+=a+b; else if((x=='T'&&y=='J')||(x=='J'&&y=='S')||(x=='S'&&y=='M')||(x=='M'&&y=='H')||(x=='H'&&y=='T')) sum2+=a+b; else if((x=='J'&&y=='M')||(x=='S'&&y=='H')||(x=='M'&&y=='T')||(x=='H'&&y=='J')||(x=='T'&&y=='S')) { if(a>b) sum1+=a-b; else sum1+=b-a; } else if((x=='M'&&y=='J')||(x=='H'&&y=='S')||(x=='T'&&y=='M')||(x=='J'&&y=='H')||(x=='S'&&y=='T')) { if(a>b) sum2+=a-b; else sum2+=b-a; } getchar(); } if(sum1>sum2) printf("Jia\n"); else if(sum1<sum2) printf("Yi\n"); else printf("Ping\n"); } return 0; }
XTU—1190 Game of Wuxing
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。