如何用Java编写一个程序,将输入的数字重新倒叙排列?

[复制链接]
查看11 | 回复3 | 2016-1-10 16:25:45 | 显示全部楼层 |阅读模式
思路如下:1,录入字符串2,使用正则表达式分割3,转换为int数组4,排序5,拼接,代码如下:import java.util.Arrays;import java.util.Scanner;public class Demo8 {public static void main(String[] args) {Scanner sc = new Scanner(System.in);String str = sc.nextLine();// 录入字符串String[] strs = str.split(",");// 使用正则表达式进行分割int[] is = new int[...
回复

使用道具 举报

千问 | 2016-1-10 16:25:45 | 显示全部楼层
import java.util.*;public class Test{public static void main(String args[]){ System.out.print("Please inputthe numbers: ");String input = new Scanner(System.in).nextL...
回复

使用道具 举报

千问 | 2016-1-10 16:25:45 | 显示全部楼层
yaoyong henduo dongxi
buhao shuo...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行