public class ldigit
{
public static void main( String args[])
{
int a;
int lastdigit;
Scanner input = new Scanner(System.in);
int n = input.nextInt();
a = n;
while( n>10 )
{
a = a / 10;
}
lastdigit = n % 10;
System.out.println("firstdigit" + a );
System.out.println("last digit" + lastdigit);
}
}
質問する
2569 次