标签:har job http ring ash imp tps code dash
https://github.com/jobbole/ProgrammingProjectList
package com.zrl.github; import java.util.Scanner; public class ReverseString { public static void main(String[] args) { Scanner cin = new Scanner(System.in); System.out.println("请输入一个字符串:"); while(cin.hasNext()) { StringBuilder sb = new StringBuilder(cin.nextLine()); //定义可变长的线程不安全字符串 //sb.reverse(); String sb1 = ""; int n = sb.length(); for(int i=0; i<n; i++) { char x = sb.charAt(n-i-1); sb1 += x; } System.out.println("输出逆转后的字符串:" + sb1); System.out.println("请输入一个字符串:"); } } }
标签:har job http ring ash imp tps code dash
原文地址:https://www.cnblogs.com/Roni-i/p/10087972.html