解题思路:
注意事项:
参考代码:import java.util.Scanner;
public class Java {
public static void java(String[] args) {
Scanner scanner = new Scanner(System.in);
int a = scanner.nextInt();
int x [] = new int [a];
int c = -1 ;
for( int i = 0 ; i < a ; i ++ ) {
x[i] = scanner.nextInt();
}
int s = scanner.nextInt();
for( int i = 0 ; i < a ; i ++ ) {
if (x[i] == s) {
c = i + 1;
break;
}
}
System.out.println(c);
}
}
0.0分
1 人评分
22308 石江青 2023-12-14 21:04:38 |
怎么哪里都有你666