题解 | #数字颠倒#
数字颠倒
https://www.nowcoder.com/practice/ae809795fca34687a48b172186e3dafe
import java.util.Scanner;
import java.util.*;
import java.io.*;
// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
public static void main(String[] args) throws IOException{
BufferedReader bf =new BufferedReader(new InputStreamReader(System.in));
String str;
HashSet<Character> hs=new HashSet<>();
while ((str=bf.readLine())!=null){
StringBuilder sb=new StringBuilder();
System.out.println(sb.append(str).reverse().toString());
}
}
}
查看22道真题和解析