AT_abc477_a.Traffic Light
入门
通过率:0%
时间限制:2.00s
内存限制:1024MB
AC君温馨提醒
该题目为【atcoder】题库的题目,您提交的代码将被提交至atcoder进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
The color of a certain traffic light changes periodically in the order B (blue), Y (yellow), R (red), B (blue), Y (yellow), R (red), ….
You are given a character c representing the current color of the traffic light. Output the next color of the traffic light.
某个交通信号灯的颜色按 B(蓝色)、Y(黄色)、R(红色)、B(蓝色)、Y(黄色)、R(红色)、… 的顺序周期性变化。
给定一个字符 c,表示交通信号灯当前的颜色。输出交通信号灯的下一个颜色。
输入格式
The input is given from Standard Input in the following format:
c
输入从标准输入中按以下格式给出:
c
输出格式
Output the character representing the next color of the traffic light.
输出代表交通灯下一个颜色的字符。
输入输出样例
输入#1
B
输出#1
Y
输入#2
R
输出#2
B
输入#3
Y
输出#3
R
说明/提示
Sample 1 Explanation:
The color after B (blue) is Y (yellow). Thus, output Y.
Sample 2 Explanation:
The color after red is blue.
Constraints
- c is one of
B,Y, andR.
样例 1 解释:
B(蓝色)之后的颜色是 Y(黄色)。因此,输出 Y。
样例 2 解释:
红色之后的颜色是蓝色。
约束条件
- c 是
B、Y和R中的一个。
输入解题思路,AI测评打分。不知道怎么写?