Problem description
123321 is a very special number, it reads from the left and reads from the right is the same.
Enter a positive integer n, programming all such five-bit and six-bit decimal numbers to satisfy the sum of the numbers equal to N.
Input format
Enter a row that contains a positive integer n.
Output format
An integer that satisfies the condition is output in order from small to large, with each integer occupying one row.
Sample input
52
Sample output
899998
989989
998899
Data size and conventions
1<=n<=54.
#include <stdlib.h> #include <time.h> #include <iostream> #include <stdio.h>using namespace St D;int Main (int argc, char* argv[]) {int n=0;//cin>>n;n=50;for (int i=10000;i<=99999;i++) {if (i/10000!=i%10) Continue;if ((i-i/10000*10000)/1000! = (i%100)/10) continue;if (((I%10+I%100/10) + i%1000/100) ==n) cout<<i& Lt;<endl;} for (int i=100000;i<=999999;i++) {if (i/100000!=i%10) continue;if (i%100000/10000!=i%100/10) continue;if (i%10000/ 1000!= i%1000/100) continue;if ((i%10+i%100/10+i%1000/100) *2==n) Cout<<i<<endl;} cout<< "\ n" <<clock () << "MS"; return (0);}
Blue Bridge Cup Foundation practice special Palindrome number