您好,你的表述不是很清晰,大概应该是这样:import java.util.ArrayList;
import java.util.Scanner;
public class taozi {
public static void main(String[] args) {
Scanner reader=new Scanner(System.in);
int n = reader.nextInt();
while(n<0||n>100){
System.out.println("n不符合范围,请重新输入");
n = reader.nextInt();
}
ArrayList
shu=new ArrayList
();
for(int i=0;i
int p= reader.nextInt();
shu.add(p);
}
int m= reader.nextInt();
while(m>shu.size()-1){
System.out.println("m不符合范围,请重新输入");
m= reader.nextInt();
}
shu.remove(m);
int k= reader.nextInt();
for(int j=0;j
if(shu.get(j)==k)shu.remove(j);
}
}
}