JAVA技巧(字符反轉實例)
導入Java . io . buffered reader;
導入Java . io . io exception;
導入Java . io . inputstreamreader;
public class trans {
public static void main(String[]args)throws io exception {
system . out . println("輸入字符串:");
buffered reader buf = new buffered reader(new InputStreamReader(system . in));
system . out . println(new string buffer(buf . readline())。反轉()。toString());
}
}
前段時間去麪試寫了一個性格反轉法,就是性格反轉的實現。
0條評論