public class Demo12 {
public static void main(String[] args) {
int[] a={8,4,2,1,23,344,12};
int b,c=0;
boolean x=false; //用Boolean语句判断
System.out.println("请输入一个数");
Scanner scanner =new Scanner(System.in);
int d=scanner.nextInt();
for (int i=0;i
b=a[i];
if (d==b){
x=true;
break;
}
}
if (x){ //只有Boolean为true的时候if(x)才输出
System.out.println("包含");
}
}
}