输入样例:
He11ll00d323o w1232154304343or8ld!
输出样例:
!dlrow odlleH
代码:
public class Test01 {
public static void main(String[] args) {
//创建字符串
String str="He11ll00d323o w1232154304343or8ld!";
//定义一个变量存放str.length()
int i=str.length();
//i不为0时,str遍历不停止
while (i!=0) {
//i--获得str最后一位的数组下标
i--;
//当获取到的字符是数字时,直接执行下次循环,不输出
if('0'<=str.charAt(i) & str.charAt(i)<='9'){
continue;
}
System.out.print(str.charAt(i));
}
}
}