This https://www.codechef.com/CCRR2021/problems/CCRR002 is the codechef contest question. I can't figure out that what's wrong with my C++ code
#include<bits/stdc++.h>
using namespace std;
int main()
{
int T;
cin>>T;
while(T--){
int l;
cin>>l;
for(int i=pow(10,l-1);i<pow(10,l);i++)
{
if(i%10!=0)
cout<<i<<endl;
}
}
return 0;
}
Raashi was given a task to a crack password. Given a length ‘l′, Raashi wants to try all passwords of length ‘l′. Help her to find all possible passwords of length ‘l′ using recursion. Digits of the password are from 1 to 9.
Input: First line contains integer ‘t’, denoting number of testcases. For each testcase: There is one integer ‘l’. Output: For each testcase print all the possible passwords separated by new line.
Constraints 1≤t≤6 1≤l≤6
Sample Input: 1 2
Sample Output: 11 12 13 14 15 16 17 18 19 21 22 23 24 25 26 27 28 29 31 32 33 34 35 36 37 38 39 41 42 43 44 45 46 47 48 49 51 52 53 54 55 56 57 58 59 61 62 63 64 65 66 67 68 69 71 72 73 74 75 76 77 78 79 81 82 83 84 85 86 87 88 89 91 92 93 94 95 96 97 98 99