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