Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 2927 Accepted Submission(s): 1873
#include <iostream>
#include<cstdio>
using namespace std;
int main()
{
int t;
int n;
char c1,c2;
int s1,s2;
scanf("%d",&t);
while(t--)
{
s1=s2=0;//!!注意初始化位置
scanf("%d",&n);
getchar();//
while(n--)
{
scanf("%c %c",&c1,&c2);
getchar();//
if(c1==c2) continue;
else if(c1==‘R‘&&c2==‘S‘||c1==‘S‘&&c2==‘P‘||c1==‘P‘&&c2==‘R‘)
{
s1++;
}
else
s2++;
}
if(s1==s2) printf("TIE\n");
else if(s1>s2) printf("Player 1\n");
else printf("Player 2\n");
}
return 0;
}
原文:http://www.cnblogs.com/Roni-i/p/7220277.html