剑指offer-20 Posted on 2020-07-31 Edited on 2025-02-13 In 剑指offer 题目 结果 代码12345678910111213class Solution { public boolean isNumber(String s) { try { if (s.endsWith("f") || s.endsWith("D")) { return false; } Double.parseDouble(s); return true; } catch (NumberFormatException e) { return false; } }} 复杂度idk