tnfh.net
当前位置:首页 >> JAvA一维数组编写一个程序使之从键盘读入10个整数... >>

JAvA一维数组编写一个程序使之从键盘读入10个整数...

//不要全部粘贴复制,这个你应该明白,包名和类名都不一样的package 作业;import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;public class Demo { public static void main(String[] args) { // TODO...

java.util.Scanner scanner = new java.util.Scanner(System.in); int len = 10; int[] result = new int[len]; for(int i=0;i=0;i--){ System.out.println(result[i]); } 放到主函数里就可以了 采纳哦

import java.util.Scanner;public class Array {public static void main(String[] args) {Scanner scanner = new Scanner(System.in);int [] a = new int[10];int count = 0;System.out.println("请输入10个整数");while (true) {if(scanner.ha...

public class TestBaiduKnow { public static void main(String[] args) { int[] a = { 9, 8, 7, 10, 6, 5, 4, 3, 2, 1 }; System.out.println("原始数组:"); for (int i = 0; i < a.length; i++) System.out.print(a[i] + " "); for (int i = ...

public class E {/** * @param args *///如(1,3,5,12,4,6,8,9,15,11)public static void main(String[] args) {// TODO Auto-generated method stubint a[]={1,3,5,12,4,6,8,9,15,11};for (int i = 1; i < a.length; i++) {for (int ...

以下代码,请复制粘贴运行,注意包的正确引入,请采纳! package util;/** * @author dayu * @version 创建时间:2018年5月8日 下午2:17:51 * 类说明 */public class test { public static void main(String[] args) { //定义数组 int [] temp=n...

package Test; import java.util.Scanner; public class test { public static void main(String[] args) { Scanner sca = new Scanner(System.in); int[] ints = new int[10]; System.out.println("请输入10个数字"); for (int i = 0; i < 10; ...

private static void p5 () { int[] arr = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 19 }; int min = Integer.MAX_VALUE; int max = Integer.MIN_VALUE; for ( int i = 0; i < arr.length; i++ ) { int ai = arr[i]; if (ai > max) { max = ai; } if (ai <...

#includevoid main(){ int i,j,a[]; for(i=0; i

import java.util.ArrayList; import java.util.List; class Test { public static void main(String[] args) { int count = 0; int s = 0; List list = new ArrayList(); int a[] = { 1, 14, 85, 36, 78, 74, 11, 3, 9, 17 }; for (int i = 0; ...

网站首页 | 网站地图
All rights reserved Powered by www.tnfh.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com