测试数据有多组,输入n(1<=n<=200),接着输入n个数,然后输入x。
对于每组输入,请输出结果。
2 1 3 0
-1
while True: try: a,b,c=input(),list(map(int,input().split())),int(input()) print(b.index(c) if c in b else -1) except: break
try: while 1: n = input() L = map(int, raw_input().split()) try: print L.index(input()) except: print -1 except: pass
这道题你会答吗?花几分钟告诉大家答案吧!
扫描二维码,关注牛客网
下载牛客APP,随时随地刷题