lzth.net
当前位置:首页 >> jAvA编写应用程序,输入 10个整数,然后按从小到大的顺序输出大神们帮帮忙 >>

jAvA编写应用程序,输入 10个整数,然后按从小到大的顺序输出大神们帮帮忙

public static void main(String[] args) { Scanner input = new Scanner(System.in);//创建Scanner对象 int[] arrayInt = new int[10];//声明一个数组 长度为10 for (int i = 0; i < arrayInt.length; i++) { //循环输入数字,放入arrayInt数组 System.out.print(

import java.util.Scanner;public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = 10; int[] b = new int[a]; int i=0; int c = 0;int d=0; while(i<a){ b[i]=sc.nextInt(); if(i!=0){ c=(c>b[i])?b[i]:c;d=(d<b[i])?b[i]:d; }

SumTest.java 源代码如下: import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader;/** by noone2009 */ public class SumTest { public static void main(String[] args) { BufferedReader br = new BufferedReader(

int a[] = null; 所以 a[i]=userNum;这句话报空. 改为int[] a=new int[10]; for(i=0;i<=10;i++){ 改为:for(i=0;i<10;i++){

public class Print { public static void main(String[] args) { Scanner s = new Scanner (System.in); int sum = 0; for (int i = 0; i < 2; i++) { sum += s.nextInt(); } System.out.println(sum); } }

import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Random; public class RandomOut { static Random r = new Random(); static List<Integer> randomList = new ArrayList<Integer>(); static int randomNumber = 0;

对不起啊!刚下线了~~#includemain(){int a[10],i,j,t; for(i=0;iif(data[i]>data[j])改为if(data[i]全部

import java.util.*; public class Test{ public static void main(String[]args){ Scanner input=new Scanner(System.in); //假如输入10个数; System.out.println("请输入要排列的数"); int[]a=new int [10]; for(int i=0;i<a.length;i++){ //初始化数组 a[i]

import java.util.*; public class A{ public static void main(String args[]){ int a={3,2,1,4,5,7,2,3,8,7}; Arrays.sort(a); System.out.println(Arrays.toString(a)); } }

Integer arryNum[]; int count = 0;/* 统计数字 */ boolean judgeIsNum = true; StringBuffer stringbuffer = new StringBuffer(); Scanner scanner = new Scanner(System.in); String character; int memoryNum; /** * 任意输入字符* * @return 返回输入的内

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