解题
马力西古 2019-03-06 12:11:48 Write a program that will read one line of input from the terminal. The input is supposed to consist of two parts separated by a colon :. As its result, your program should produce a single character as follows:
N No colon on the line.
L The left part (before the colon) is longer than the right.
R The right part (after the colon) is longer than the left.
D The left and right parts have the same length but are different.
S The left and right parts are exactly the same.
Examples:
Input Output
Sample Sample N
Left:Right R
Sample:Sample S
Dog:Cat D
Rabbit:Dog L
【输入】
字符串的数量n
第2到n+1行分别输入需要分析的字符串
【输出】
N条字符串的判断结果
例如:
【输入】
3
Sample Sample
Dog:Cat
Rabbit:Dog
【输出】
N
D
L