how to print nth palindrome number in c 2b 2b

Solutions on MaxInterview for how to print nth palindrome number in c 2b 2b by the best coders in the world

showing results for - "how to print nth palindrome number in c 2b 2b"
Philipp
15 Sep 2020
1
2if(n <=1000 && i==0){
3               // cout << " here "<<endl;
4                count =0;
5                i=0;
6               // break;
7                
8            }else if( n >1000 && n <=2000 && i==0){
9                //cout << "there " <<endl;
10                count =1000;
11                i=90109;
12               // break;
13            }else if( n >2000 && n <=2500 && i==0){
14                //cout << "there " <<endl;
15                count =2000;
16                i=1001001;
17                // break;
18            }else if( n >2500 && n <=3000 && i==0){
19                //cout << "there " <<endl;
20                count =2500;
21                i=1501051;
22                // break;
23
24
Christian
07 Jun 2018
1 int n;
2    int count =0;
3    while(true){
4        cin>> n;
5        if (n == 0) return 0;
6        
7        if( n <= 10000){
8        for( int i=1 ; i <= 2000000000; i++){
9
10                if( palindrom(i) == true) {
11                    count++;
12                    //cout << "palindrom : " << i<< " count : " << count <<endl;
13                
14                
15                    if( count == n ) {
16                    
17                        cout << i <<endl;
18                   
19                        count =0;
20                        break;
21                    }
22