import java.util.*; public class Main { public static void main(String[] args) { int n,i,a; int flag = 0; Scanner scanner = new Scanner(System.in); n = scanner.nextInt(); int[] b = new int[n]; for(i = 0;i < n;i++) { b[i] = scanner.nextInt(); } a = scanner.nextInt(); for(i = 0;i< n;i++) { if(b[i]==a) { System.out.println(i+1); flag = 1; break; } } if(flag == 0){ System.out.println(-1); } } }
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)