• 2021 Palindrome Numbers

    时间限制 : 2000/1000 MS(Java/Others) | 内存限制 : 131072/65536 KB(Java/Others)

    提交数 : 85 | 通过数 : 25

    题目描述

    A palindrome is a word, number, or phrase that reads the same forwards as backwards. For example, the name "anna" is a palindrome. Numbers can also be palindromes (e.g. 151 or 753357). Additionally numbers can of course be ordered in size. The first few palindrome 
    numbers are: 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33, ... 
    The number 10 is not a palindrome (even though you could write it as 010) but a zero as leading digit is not allowed.

    输入要求

    The input consists of a series of lines with each line containing one integer value i (1<= i <= 2*10^9 ). This integer value i indicates the index of the palindrome number that is to be written to the output, where index 1 stands for the first palindrome number (1), index 2 stands for the second palindrome number (2) and so on. The input is terminated by a line containing 0.

    输出要求

    For each line of input (except the last one) exactly one line of output containing a single (decimal) integer value is to be produced. For each input value i the i-th palindrome number is to be written to the output.

    输入样例

    1
    12
    24
    0
    

    输出样例

    1
    33
    151
    

    提示

    输出会超过32位整数类型,请用__int64类型
    例:
    __int64 n;
    输入则是:
    scanf("%I64d", &n);
    输出是
    printf("%I64d",n);

    来源

    Tehran 2003 Preliminary

    [ 返回顶端 ] | [ 代码提交 ] | [ 统计数据 ] | [ 历史提交 ]