设N是一个三位数,如何求出N的各位数字?用Java编程
class test
{
public static void main(String []atrs)
{
int a,b,c,n;
n=123;
a=n/100;
b=n/10%10;
c=n%100%10;
System.out.println(a+","+b+","+c);
}
}
class test
{
public static void main(String []atrs)
{
int a,b,c,n;
n=123;
a=n/100;
b=n/10%10;
c=n%100%10;
System.out.println(a+","+b+","+c);
}
}