7-13 统计字符在字符串中第n次出现的位置 (30分)

    技术2022-07-11  65

    s = input() n = int(input()) x = input() for i in range(len(s)): if s[i] == x: n -= 1 if n == 0: print(i+1) break else: if n != 0: print('no')

     

    Processed: 0.015, SQL: 9