题目描述
接受一个只包含小写字母的字符串,然后输出该字符串反转后的字符串。(字符串长度不超过1000)
输入描述:
输入一行,为一个只包含小写字母的字符串。
输出描述:
输出该字符串反转后的字符串。
示例1
输入
abcd
输出
import java.util.*; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); String[] strs = in.nextLine().split(""); in.close(); for (int i = strs.length - 1; i >=0 ; i--) { System.out.print(strs[i]); } } }