mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
25 lines
561 B
C++
25 lines
561 B
C++
|
#include<stdio.h>
|
||
|
int main ()
|
||
|
{
|
||
|
char str[20];
|
||
|
int r, y, n;
|
||
|
int i;
|
||
|
while(~scanf("%d", &n) && n)
|
||
|
{
|
||
|
r = 7;
|
||
|
y = 7;
|
||
|
getchar();
|
||
|
gets(str);
|
||
|
for(i = 0 ; i < n; i++)
|
||
|
switch(str[i])
|
||
|
{
|
||
|
case 'R': r--; break;
|
||
|
case 'Y': y--; break;
|
||
|
case 'B': if(r) printf("Yellow\n"); else printf("Red\n"); break;
|
||
|
case 'L': if(y) printf("Red\n"); else printf("Yellow\n"); break;
|
||
|
default:break;
|
||
|
}
|
||
|
}
|
||
|
return 0;
|
||
|
}
|