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
uj5u.com熱心網友回復:
大老總又來下任務...
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/42707.html
標籤:基礎類
