a111: TENET
Tags :
Accepted rate : 162人/180人 ( 90% ) [非即時]
評分方式:
Strictly

最近更新 : 2022-11-01 17:09

Content

判斷句子是否「回文」句子

Input

一行字符串

Output

True or False

Sample Input #1
TENET
Sample Output #1
True
Sample Input #2
TENED
Sample Output #2
False
Sample Input #3
DENED
Sample Output #3
True
Sample Input #4
DENEDD
Sample Output #4
False
測資資訊:
記憶體限制: 64 MB
不公開 測資點#0 (33%): 1.0s , <1K
不公開 測資點#1 (33%): 1.0s , <1K
不公開 測資點#2 (34%): 1.0s , <1K
Hint :

You can simply read the input() as string (no "integer conversion" is needed this time) and then verify the digit (from both directions, left and right). Note that you may need to handle the "negative" symbol by yourself.

>> thislist = ["apple", "banana", "cherry"]
>> print(thislist[::-1])

Tags:
出處:
[管理者:
kichan@g.pui... (陳嘉賢CHAN KA IN)
]


ID User Problem Subject Hit Post Date
沒有發現任何「解題報告」