import java.util.Scanner;//导包 public class New01 { public static void main(String[] args) { int arr[] = {1,25,24,21,31,16,15,18,14,0}; //创建键盘输入对象 Scanner sc = new Scanner(System.in); System.out.print("请输入您要查找的数:"); //输入数据 int math = sc.nextInt(); boolean t = false; for (int i = 0; i < arr.length; i++) { if (arr[i] == math) { t = true; } } if (t) { System.out.println("yes"); }else{ System.out.println("no"); } } }
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)