标签:io java ar for c new r 学习 as
import java.io.*; import java.util.*; import java.math.*; import java.text.*; public class Main { public static void main(String[] args){ Scanner in=new Scanner(System.in); int x,n; while(in.hasNext()){ n=in.nextInt(); int[] a=new int[n]; for(int i=0;i<n;i++) a[i]=in.nextInt(); Arrays.sort(a); x=in.nextInt(); if(Arrays.binarySearch(a,x)>=0) System.out.println("YES"); else System.out.println("NO"); } } }
标签:io java ar for c new r 学习 as
原文地址:http://blog.csdn.net/qq_16255321/article/details/39321761