(JAVA)从键盘中输入一个数组 public class Test{public static void main(String args[])throws IOException{BufferedReader br=new BufferedReader(new InputStreamReader(System.in));int temp[10];int sum;for(int i=0;i;i+){temp[i]=Integer.parseInt(br.readLine());sum+temp[i];}System.out.println(sum*sum);}}
java 键盘输入二维数组 源代码:import java.util.Scanner;public class 二维数组 {public static void main(String[]args){TODO Auto-generated method stubSystem.out.println(\"输入你需要的阶层数:\");Scanner scan=new Scanner(System.in);int n=scan.nextInt();定义需要的阶层数nint[][]array=new int[n][n];定义一个n*n的数组arraySystem.out.println(\"输入数组的各个元素:\");for(int i=0;i;i+){for(int j=0;j;j+){array[i][j]=scan.nextInt();给数组赋值}}System.out.println(\"你输入的数组为:\");for(int i=0;i;i+){for(int j=0;j;j+){System.out.print(array[i][j]+\"\\t\");if(j=n-1)System.out.println();}}}}
java程序中从键盘输入一组数组并输出,再输出其中最大值和最小值 import java.util.Scanner;public class Test {public static void main(String[]args){e79fa5e98193e78988e69d8331333332623261Scanner s=new Scanner(System.in);System.out.println(\"请输入你要输的数组长度:\");int lenth=s.nextInt();System.out.println(\"请分别输入\"+lenth+\"个数:\");int[]shuZu=new int[lenth];for(int i=0;i;i+){shuZu[i]=s.nextInt();}int max=shuZu[0];int min=shuZu[0];System.out.println(\"您输入的数组为:\");for(int i=0;i;i+){System.out.print(\"\"+shuZu[i]);if(max[i])max=shuZu[i];if(min>;shuZu[i])min=shuZu[i];}System.out.println(\"\\n最大值:max=\"+max);System.out.println(\"最小值:min=\"+min);}}这个不知道满不满足要求呢?