0
点赞
收藏
分享

微信扫一扫

HDOJ  2537   8球胜负

小迁不秃头 2022-08-23 阅读 34


题目:​​http://acm.hdu.edu.cn/showproblem.php?pid=2537​​

#include <iostream>
using namespace std;
int main()
{
char a;
string s;
int n,red,yellow,c,d;
while(cin>>n,n)
{
yellow=red=0;
for(int i=0;i<n;i++)
{
cin>>a;
if(a=='Y') yellow++;
if(a=='R') red++;
}
if(a=='B'&&red==7)
s="Red";
if(a=='L'&&yellow<7)
s="Red";
if(a=='B'&&red<7)
s="Yellow";
if(a=='L'&&yellow==7)
s="Yellow";
cout<<s<<endl;
}
return 0;
}

举报

相关推荐

0 条评论