"Ordered palindrome number" of OJ brush problem

Source: Internet
Author: User

Title Description

ordered palindrome number is a very special number, like 43211234 , 321123 , and now I put One called first-order palindrome number, 2112 called second-order palindrome number, and so on.
Xiaoping just began to learn recursion, want to use a recursive method to output a N (<=9) the number of palindrome of the order. Can you help him?

Input

an integer variable N , indicating that the first N Order palindrome number.

Output

Section N Order palindrome Number

Sample input

3

Sample output

321123

Tips

The main function is given below, and it is not required to include the following main function when committing

#include <stdio.h>

int main ()

{

int n;

void Digui (int);

scanf ("%d", &n);

Digui (n);

return 0;

}

#include <iostream> #include <cstdio>using namespace Std;int main () {    int n;    void Digui (int);    cin>>n;    Digui (n);    return 0;} void Digui (int n) {    int i;    for (i=n;i>=1;i--)        cout<<i;    for (i=1;i<=n;i++)        cout<<i;}


Operation Result:

I am now learning that the standard format of the C++;c language is not very familiar, so I have to use C + + code to write. Submit only functions on OJ, head file iostream and using namespace std; add in front.

"Ordered palindrome number" of OJ brush problem

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.