17: Non-repeating integer extraction Norepeatnum

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.