Count numbers
Submissions: 1249   Accuracy:

54.65%

  Difficulty: Easy   Marks: 2

Given a number n, write a program that returns count of numbers from 1 to n that don’t contain digit 3 in their decimal representation.

Input:

The first line of input contains an integer T denoting the number of test cases.
The first line of each test case is N.

Output:

Print the total numbers that don't contain digit 3.

Constraints:

1 ≤ T ≤ 100
1 ≤ N ≤ 500

Example:

Input
2
10
45

Output
9
31    // 3,13,23,30,31,32,33,34,35,36,37,38,39,43

 

** For More Input/Output Examples Use 'Expected Output' option **

Author: rajatjha


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.