Title Description
Enter an int that returns a new integer that does not contain a repeating number in the right-to-left reading order.
Input Description: Enter an int type integer
Output Description: Returns a new integer that does not contain a repeating number in the right-to-left reading order
Input Example:
9876673
Output Example:
37689
ImportJava.util.Scanner;/*Title Description Enter an int integer that returns a new integer that does not contain a repeating number in the right-to-left reading order. Input Description: Enter an int type integer OUTPUT description: Returns a new integer input example with no repeating number in the right-to-left reading order: 9876673 Output Example: 37689*/ Public classNorepeatnum { Public Static voidMain (string[] args) {Scanner in=NewScanner (system.in); String input=In.nextline (); int[] temp =New int[10]; intLength =input.length (); for(inti=length-1;i>=0;i--){ if(Temp[input.charat (i)-48] = = 0) {System.out.print (Input.charat (i)-48); Temp[input.charat (i)-48]++; } } }}
but-48
17: Non-repeating integer extraction Norepeatnum