栈(stack) 实现字符串反转

时间:2025-04-04 13:10:53
package ; import ; import ; import ; import ; /** * Created by nanzhou on 2017/8/2. */ public class ReverseOrder { public static void main(String[] args) throws IOException { for (; ; ) { Stack<String> stack = new Stack(); System.out.println("please input words "); System.out.flush(); String s = getString(); for (int i = 0; i < (); i++) { (String.valueOf((i))); } String result = ""; while (!()) { result += (); } System.out.println(result); }} public static String getString() throws IOException { InputStreamReader inputStreamReader = new InputStreamReader(System.in); BufferedReader reader = new BufferedReader(inputStreamReader); String s = (); return s; } }

相关文章