package com.ssdou; import java.util.Scanner; public class Translate { public static void main(String[] args) { // TODO Auto-generated method stub Scanner input = new Scanner (System.in); String a = input.nextLine(); String b = a.toLowerCase(); StringBuffer c =new StringBuffer(""); for (int i=0;i<a.length();i++){ if ('o'>b.charAt(i)&&b.charAt(i)>'g'){ c = c.append(b.charAt(i)); } } String d = ""+c; System.out .println("十进制数为:"+ Integer.parseInt(d, 10)); } }
这里
System.out .println("十进制数为:"+ Integer.parseInt(d, 10)); 会产生Exception in thread "main" java.lang.NumberFormatException: For input string: ""异常 怎么解决
f_life
相关分类