文章转载自https://blog.csdn.net/Richard__Ting/article/details/80772174 判断是否为数字 #include <iostream> #include <iomanip> #include <string> #include <cctype> //判断字符类型需要的头文件 using namespace std; int main() { string str; int len; int n; int c…
转载:https://blog.csdn.net/u013066244/article/details/53197756 用JAVA自带的函数 public static boolean isNumericZidai(String str) { for (int i = 0; i < str.length(); i++) { System.out.println(str.charAt(i)); if (!Character.isDigit(str.charAt(i))) { return fal…