1
Count函數的最後一行只算我的清單最後一行計數功能只算我的清單
N = int(raw_input())
cnt = []
for i in range(N):
string = raw_input()
for j in range(1,len(string)):
if string[j] =='K':
cnt.append('R')
elif string[j] =='R':
cnt.append('R')
if string[0] == 'k':
cnt.append('k')
elif string[0] == 'R':
cnt.append('R')
print cnt.count('R')
,如果我給輸入: -
2
RKKRK
RKKR`
這是給最後一行的答案只有 的RKKR
的樣子;你認爲'在範圍(N)'循環中結束? –
字符串變量是在寫RKKR和第一輸入RKKRK丟失,所以串只包含RKKRK – Bharadwaj
是妳正確的,但我該如何解決售後服務它 –