Skip to content

Commit 9dbc07d

Browse files
authored
1520B
1 parent e24dd9e commit 9dbc07d

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

Ordinary_Numbers.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#include <bits/stdc++.h>
2+
using namespace std;
3+
int main(){
4+
int test;
5+
cin>>test;
6+
while(test--)
7+
{
8+
long long n;
9+
long long counter=0, j;
10+
cin >> n;
11+
for(int i=1; i<=9; i++)
12+
{
13+
j=i;
14+
while(j<=n)
15+
{
16+
count++;
17+
j=j*10+i;
18+
}
19+
}
20+
cout << count << endl;
21+
}
22+
}

0 commit comments

Comments
 (0)