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

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

import java.util.Scanner;public class test1 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a[] = new int [10]; for(int i=0;i=0;j-- ){ System.out.print(a[j]+" "); } }}

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]); } 放到主函数里就可以了 采纳哦

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

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 = 0; i <...

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; ...

public class Test { public static void main(String args[]) { int a[]={84,40,16,3,10,49,28,76,94,70}; int n; int min=a[0]; int i; int max=a[0]; for(n=0;n

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; ...

什么题?

import java.util.Scanner ; public class Test{ public static void main(String args[]){ Scanner input = new Scanner(System.in) ; //接受键盘数据实例化对象, int[] x = new int[10]; for(int i = 0; i

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