题解 | #字符串反转#
字符串反转
http://www.nowcoder.com/practice/e45e078701ab4e4cb49393ae30f1bb04
import java.util.Scanner; import java.util.Stack; public class Main{ public static void main(String[] args){ Scanner input = new Scanner(System.in); Stack ss = new Stack(); String s = input.nextLine(); for(int i=0;i<s.length();i++){ char m = s.charAt(i); ss.push(m); } for(int j =0;j<s.length();j++){ System.out.print(ss.pop()); } } }