public class Test {
public static void main(String[] args) {
int num = 751;
String str = String.valueOf(num);
for (int i = 0; i < str.length(); i++)
if (i == 0)
System.out.println("百位:" + str.charAt(i));
else if (i == 1)
System.out.println("十位:" + str.charAt(i));
else
System.out.println("个位:" + str.charAt(i));
}
}