请问这应该怎样写那边才不报错?

图片说明

num[0] == target
->
num.elementAt(0) == target

这个vector是一个对象 ,不是一个数组,数组才是这样用的[]