解题

马力西古 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
...全文
52 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
大老总又来下任务...

13,825

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧