Nested loops




Task
Time limit: 1000 ms,
Memory limit: 256 Mb

A palindrome is a number that is equally readable in both directions (does not change when rearranging its numbers in the reverse order).
Given a natural number K. Display the number of natural palindromes not exceeding the number K

Input: Given a single number K  (\(1<=K<=100000\)).
Output: It is necessary to deduce the number of natural palindromes not exceeding K.

Example
Input Output
1 1 1
2 100 18

Prohibited statements:list;[;find;index;reverse

Auto CHOOSE THE PROGRAMMING NECESSARY LANGUAGE!
Attach the program source file:
or enter the source code in the language:

Rules for designing programs and a list of errors during automatic task verification
           

Results: