JAVA倒序输出方法

来源:互联网 发布:windows系统优化大师 编辑:程序博客网 时间:2024/06/04 20:10
import java.util.Scanner;/** * Created by Administrator on 2017/4/7. */public class Lorder {    public static void main(String[] args) {        Scanner scan =new Scanner(System.in);        String m = scan.nextLine();        System.out.println("请输入数字:");        StringBuffer sb = new StringBuffer(m).reverse();        System.out.println("倒序结果:"+sb);    }}
1 0
原创粉丝点击