问题描述
给定一个字符串,将这个串的所有字母逆序后输出。
输入格式
输入包含一个字符串,长度不超过100,字符串中不含空格。
输出格式
输出包含一个字符串,为上面字符串的逆序。
样例输入
tsinsen
样例输出
nesnist
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
StringBuffer str = new StringBuffer();
str.append(in.nextLine());
System.out.println(str.reverse());
in.close();
}
}