public static void main(String[] args) { String s = new String("664"); byte[] strings = s.getBytes(); int sum = 0; for (int i = strings.length; i > 0; i--) { int temp =strings[strings.length-i]-48; sum += temp*Math.pow(10, i - 1); } System.out.println(sum); }
自己实现String 转化int
猜你喜欢
转载自blog.csdn.net/qq_33291307/article/details/80582449
今日推荐
周排行