shwq.net
当前位置:首页 >> JAvA从键盘上输入4个整数将这4个数按从小到大输出. >>

JAvA从键盘上输入4个整数将这4个数按从小到大输出.

import java.util.Scanner; public class test{ public static void main(String [] args){ int num[] = new num[4]; int temp = 0; for(int i = 0;i < num.length();i++ ){ System.out.println("请输入第"+(i+1)+"个数:"); num[i] = new Scann...

import java.util.Scanner; public class TestBaiduKnow { public static void main(String[] args) { Scanner sca = new Scanner(System.in); String line = sca.nextLine(); int[] a = new int[line.split(" ").length]; for (int i = 0; i < ...

import java.util.Scanner;public class Main(){ public static void main(String[] args) { int a[]=new int[4]; Scanner sc=new Scanner(System.in); System.out.println("请输入4个整数:"); for(int x:a) x=sc.nextInt(); for(int i=0;i

人家都说初学了!你们看看你们发的那叫什么答vv案! 既然你是初学,我就把所有代码都发上来! 另外我还有初学者的实例代码。多的不得了!想要的话OICQ⒉⒏⒉⒈⒋⒊⒏⒐⒌ 谁举报我不得好SI! 简单易懂! import java.io.BufferedReader; import java.io.IO...

Arrays.sort()函数

给你一个简单升序排列4个数的函数的代码 //首先输入四个数,不用我写了吧? //下面是排序函数 void PaiLie(int n1,int n2,int n3,int n4) { //初始化一个四个数的数组 int[] number=new int[4]{}; number[0]=n1; number[1]=n2; number[2]=n3; numb...

import java.util.Scanner; public class test{ public static void main(String [] args){ int num[] = new num[4]; int temp = 0; for(int i = 0;i < num.length();i++ ){ System.out.println("请输入第"+(i+1)+"个数:"); num[i] = new Scann...

public class IntTest { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int i = sc.nextInt(); if(i=1000){ //1 String s = new Integer(i).toString(); int sum = 0; for(int j = 0,k=s.length();j

int temp = 0; int a[] = {1,2,4,10,8,7,5,6,9,3}; for(int i=0;i

import java.util.Arrays;public class Smalltobig {/** * @param args */public static void main(String[] args) {// TODO Auto-generated method stubint [] num = {2,1,5,4};Arrays.sort(num);for(int getnum : num){System.out.println(get...

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