hdoj 2537

来源:互联网 发布:知乎 三体问题 编辑:程序博客网 时间:2024/05/21 07:05

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

//水题#include <string>#include <iostream>using namespace std;int main(){ int rsum, ysum, n; int i; string str; while (cin >> n && n) {  cin >> str;  rsum = ysum = 0;  for (i = 0; i < str.length()-1; i++) {   if (str[i] == 'R') rsum ++;   if (str[i] == 'Y') ysum ++;   }  if (str[i] == 'B' && rsum != 7) puts("Yellow");  if (str[i] == 'B' && rsum == 7) puts("Red");  if (str[i] == 'L' && ysum != 7) puts("Red");  if (str[i] == 'L' && ysum == 7) puts("Yellow"); } return 0;}


 

原创粉丝点击