Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: For each K, output the smallest palindrome larger than K.

  1. #1
    Junior Member
    Join Date
    Jul 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default For each K, output the smallest palindrome larger than K.

    Hello People.
    I have some task...

    "A positive integer is called palindrom if his team in the same system Decade
    when read from left to right and from right to left. For a given positive integer k with no more than
    12 digits to write the smallest value greater than K palindrom. The numbers are always
    written without a leading zero (0)."

    Input:
    The first line contains integer t, the number of test cases. Integers K are given in the next t lines.

    Output:
    For each K, output the smallest palindrome larger than K.

    example:

    input:
    2
    808
    2133

    output:

    818
    2222


    This is a task of a hope that will help me about this....Thanks in advance....


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,370
    Thanks
    183
    Thanked 836 Times in 779 Posts
    Blog Entries
    5

    Default Re: For each K, output the smallest palindrome larger than K.

    What have you done so far? Just dumping an assignment into the forums won't get you much back unless you show you've at least tried the assignment - which gives us a starting point to help you out.

  3. #3
    Forum old-timer
    Join Date
    Nov 2008
    Location
    Faversham, Kent, UK
    Posts
    471
    My Mood
    Mellow
    Thanks
    4
    Thanked 58 Times in 54 Posts

    Default Re: For each K, output the smallest palindrome larger than K.

    Please post the code you need help with, or the algorithm you're using, and explain which part is causing you problems.

Similar Threads

  1. stack Palindrome , java
    By Faha in forum Object Oriented Programming
    Replies: 1
    Last Post: May 3rd, 2011, 05:20 PM
  2. Output Largest and Smallest Integers using only If statements
    By jcattau in forum What's Wrong With My Code?
    Replies: 2
    Last Post: February 2nd, 2011, 05:55 PM
  3. Palindrome
    By mag12203 in forum Algorithms & Recursion
    Replies: 13
    Last Post: December 20th, 2010, 08:28 PM
  4. Palindrome Stacks
    By mgutierrez19 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: April 7th, 2010, 04:05 AM
  5. Check for palindrome numbers
    By SnooSnoo in forum What's Wrong With My Code?
    Replies: 7
    Last Post: March 4th, 2010, 06:11 PM