reverse number 2
Submit solution
Points:
40 (partial)
Time limit:
1.0s
Memory limit:
256M
Authors:
Problem type
Allowed languages
Java 19, Java 8
題目說明
請使用副程式反轉數值與判斷反轉後數值是否為回文(會檢查)
接續以下程式碼作答:
import java.util.Scanner;
public class t03212 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner in = new Scanner(System.in);
int n = in.nextInt();
System.out.print(re(n) + " " + isp(re(n), re(re(n))));
in.close();
}
public static int re(int a) { // 反轉數值
}
public static boolean isp(int a, int b) { // 判斷反轉後數值是否為回文
}
}
輸入
整數
輸出
反轉後的整數 是否為回文
測試資料0 輸入
12
測試資料0 輸出
21 false
測試資料1 輸入
121
測試資料1 輸出
121 true
Comments