【发布时间】:2016-05-02 03:33:21
【问题描述】:
所以说代码是这样的..
String nbr = input.nextLine(); // For example say it's 258
int a; // I want this to be the first digit of nbr
int b; // This the second
int c; // And this the third
我尝试了 charAt() 但我找不到其他任何东西... 提前谢谢各位!还在学习!
【问题讨论】:
-
您尝试了 charAt() 并且...有什么问题?
-
Integer.parseInt(nbr.substring(0,1))...
-
我很困惑问题是什么...... charAt() 给你你想要的字符。您将其转换为 int。问题解决了。