当前位置:首页 > 问答 > 正文

    如何实现“键盘上输入长度不超过20字符串,按照ASCII码值的大小,对字符串的字符从小到大排列”?

    匿名用户 2022-11-19 14:20:14提问

可以输入如下代码:public static void main(String[] args) {Scanner in = new Scanner(System.in);String temp=in.next();char[] c=new char[temp.length()];for(int i=0;i