how to print nth palindrome number in c++
C++
if(n <=1000 && i==0){
// cout << " here "<<endl;
count =0;
i=0;
// break;
}else if( n >1000 && n <=2000 && i==0){
//cout << "there " <<endl;
count =1000;
i=90109;
// break;
}else if( n >2000 && n <=2500 && i==0){
//cout << "there " <<endl;
count =2000;
i=1001001;
// break;
}else if( n >2500 && n <=3000 && i==0){
//cout << "there " <<endl;
count =2500;
i=1501051;
// break;
int n;
int count =0;
while(true){
cin>> n;
if (n == 0) return 0;
if( n <= 10000){
for( int i=1 ; i <= 2000000000; i++){
if( palindrom(i) == true) {
count++;
//cout << "palindrom : " << i<< " count : " << count <<endl;
if( count == n ) {
cout << i <<endl;
count =0;
break;
}
Also in C++:
- Title
- sort function in c++
- Category
- C++
- Title
- c++ sort vector of objects by property
- Category
- C++
- Title
- pause the console c++
- Category
- C++
- Title
- how to use a new node c++
- Category
- C++
- Title
- switch c++
- Category
- C++
- Title
- c++ while true
- Category
- C++
- Title
- max in c++
- Category
- C++
- Title
- case label in c++
- Category
- C++
- Title
- gta san andreas
- Category
- C++
- Title
- c++ short if
- Category
- C++
- Title
- how to compare lower case character to uppercase cpp
- Category
- C++
- Title
- c++ char define
- Category
- C++
- Title
- what is meaning of 64 bit integer in c++
- Category
- C++
- Title
- Convert binary tree to a doubly linked list
- Category
- C++
- Title
- rosrun actionlib_msgs genaction.py
- Category
- C++
- Title
- flushing output in c++
- Category
- C++
- Title
- pyqt connect
- Category
- C++
- Title
- conditional operator in cpp
- Category
- C++
- Title
- how to use max_element in c++ with vector
- Category
- C++
- Title
- c++ ternary operator
- Category
- C++
- Title
- tellg and seekg c++
- Category
- C++
- Title
- how to initialize a vector in c++
- Category
- C++
- Title
- c++ convert int to double
- Category
- C++
- Title
- c++ switch case statement
- Category
- C++
- Title
- first prime numbers
- Category
- C++
- Title
- how to ensure the user inouts a int and not anything else c++
- Category
- C++
- Title
- memset
- Category
- C++
- Title
- nth_element c++
- Category
- C++
- Title
- binary search in set c++
- Category
- C++
- Title
- min coin change problem dp
- Category
- C++
- Title
- heap in cpp stl
- Category
- C++
- Title
- c++ create object
- Category
- C++
- Title
- create a bitset of 1024 bits,
- Category
- C++
- Title
- variabili in c++
- Category
- C++
- Title
- pop from between string c++
- Category
- C++
- Title
- free or delete in c++
- Category
- C++
- Title
- C++ int to char*
- Category
- C++
- Title
- matrix eigen c++ example
- Category
- C++
- Title
- programa para saber si un numero es primo
- Category
- C++
- Title
- range based for loop c++ with reference
- Category
- C++
- Title
- how to format decimal palces in c++
- Category
- C++
- Title
- variabvles in c++
- Category
- C++
- Title
- #include
- Category
- C++
- Title
- c++ sql
- Category
- C++
- Title
- git branch in my bash prompt
- Category
- C++
- Title
- c++ base 10 to base 2
- Category
- C++
- Title
- c++ typeid get type name
- Category
- C++
- Title
- c++ class constructor
- Category
- C++
- Title
- c++ crash windows
- Category
- C++
- Title
- map vs unordered_map in C++
- Category
- C++
- Title
- remove item from layout
- Category
- C++
- Title
- map insert c++
- Category
- C++
- Title
- how to make a heap using stl in c++
- Category
- C++
- Title
- binary representation differ in bits
- Category
- C++
- Title
- check if key exists in map c++
- Category
- C++
- Title
- eratosthenis sieve in c++
- Category
- C++
- Title
- C++ pointer arithmetic
- Category
- C++
- Title
- Create a program that finds the minimum value in these numbers
- Category
- C++
- Title
- C++ w3schools
- Category
- C++
- Title
- object slicing in c++
- Category
- C++
- Title
- iterative inorder traversal
- Category
- C++
- Title
- pass by reference c++
- Category
- C++
- Title
- initialize vector of pointers c++
- Category
- C++
- Title
- qt make widget ignore mouse events
- Category
- C++
- Title
- string to number in c++
- Category
- C++
- Title
- error: ‘memset’ was not declared in this scope in cpp
- Category
- C++
- Title
- c++ menu selection with arrow keys
- Category
- C++
- Title
- coping 2d vector in cpp
- Category
- C++
- Title
- c++ main function
- Category
- C++
- Title
- c++ read file line by line
- Category
- C++
- Title
- c++ triple
- Category
- C++
- Title
- run program until ctrl-d c++
- Category
- C++
- Title
- c++ loop through array
- Category
- C++
- Title
- else if c++
- Category
- C++
- Title
- making random numbers in c++
- Category
- C++
- Title
- new class * [] c++
- Category
- C++
- Title
- how to compile opencv c++ in ubuntu
- Category
- C++
- Title
- reverse a linked list using recursion
- Category
- C++
- Title
- how to print a string to console in c++
- Category
- C++
- Title
- add a timer c++
- Category
- C++
- Title
- screen record ios simulator
- Category
- C++
- Title
- double max value c++
- Category
- C++
- Title
- FInd the element which appears more than n/2 times C++
- Category
- C++
- Title
- popualte an array c++
- Category
- C++
- Title
- trovare il valore massimo in un array c++ w3
- Category
- C++
- Title
- capitalize first letter c++
- Category
- C++
- Title
- centos7 mlock2
- Category
- C++
- Title
- assegnare valori in c++
- Category
- C++
- Title
- c++ uint32_t
- Category
- C++
- Title
- how to iterate through a map in c++
- Category
- C++
- Title
- how to get last element of set in c++
- Category
- C++
- Title
- c++ char to string
- Category
- C++
- Title
- Find a element in a map C++
- Category
- C++
- Title
- regexp_like oracle c++
- Category
- C++
- Title
- find number of 1s in a binary cv::mat image
- Category
- C++
- Title
- c++ map insert
- Category
- C++
- Title
- max element in array c++ stl
- Category
- C++
- Title
- c++ compare char
- Category
- C++
- Title
- std::substring
- Category
- C++
- Title
- how to decalre a string in c++
- Category
- C++