给定一个字符串。请去除串中的数字并反转。
输入格式:
原始串。
输出格式:
去除数字后的反转字符串。
输入样例:
在这里给出一组输入。例如:
he11ll00o w0or8ld!
结尾无空行
输出样例:
在这里给出相应的输出。例如:
!dlrow olleh
结尾无空行
代码:
import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s = sc.nextLine();
StringBuilder stringBuilder = new StringBuilder(s.replaceAll("\d+",""));
System.out.println(stringBuilder.reverse().toString());
}
}



