-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path695A.cpp
More file actions
38 lines (35 loc) · 715 Bytes
/
Copy path695A.cpp
File metadata and controls
38 lines (35 loc) · 715 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
scanf("%d", &t);
while (t--)
{
int n;
scanf("%d", &n);
if(n > 10){
int k = (n/10);;
n -= (k*10);
int j = 1;
for (int i = 0; i < k; i++)
{
printf("9876543210");
}
for (int i = 1; i <= n; i++)
{
printf("%d",i);
}
printf("\n");
}
else
{
int j = 0;
for (int i = 9; j < n ; i--, j++)
{
printf("%d",i);
}
printf("\n");
}
}
}