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

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

import java.util.Scanner; public class Test43 { public static void main(String[] args) { System.out.println("请输入10个数字,输入每个数字后以回车结束");// 提示语句,输入一个数要按下回车 Scanner sc = new Scanner(System.in);// 这是...

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]+" "); } }}

//不要全部粘贴复制,这个你应该明白,包名和类名都不一样的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]); } 放到主函数里就可以了 采纳哦

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

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

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

#include #include #define N 10 void main( ) { int i,j,temp; int data[N]; printf("请输入%d个数据:\n",N); for(i=0;i

#include int main() {int n,i,a[10]; n=10; printf("请输入10个整数:\n"); for(i=0;i

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