求java数组程序:

求java数组程序:,第1张

import java.util.Scanner

public class Test2 {

public static void main(String[] args) {

double[] myAry ={35, 23, 234, 165}

System.out.print("Please input a number: ")

double input = new Scanner(System.in).nextDouble()

boolean isFound = false

for(int i = 0i <myAry.lengthi++){

if(myAry[i] == input){

isFound = true

break

}

}

System.out.println(input + " can " + (isFound? "": " not ") +" be found in the ary")

}

}

import java.util.Scanner\r\n\r\npublic class NumTest {\r\n\r\npublic static void main(String[] args) {\r\n\r\nint[] nums=new int[10]\r\nScanner jin = new Scanner(System.in)\r\nfor (int i = 0i nums[i]) {\r\nsmallerNum=nums[i]\r\n}\r\nif (biggerNum 回答于 2022-12-11


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/11337954.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-15
下一篇 2023-05-15

发表评论

登录后才能评论

评论列表(0条)

保存