-
Notifications
You must be signed in to change notification settings - Fork 0
/
2550.c
32 lines (28 loc) · 1.12 KB
/
2550.c
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
#include <stdio.h>
#include <stdlib.h>
#define N 1000
char *array[100]={">++>",">+-+>",">+--+>",">+---+>",">+----+>",">+-----+>",">+------+>",">+-------+>",">+--------+>",">+---------+>",">+----------+>",">+-----------+>",">+------------+>",">+-------------+>",">+--------------+>",">+---------------+>",">+----------------+>",">+-----------------+>",">+------------------+>",">+-------------------+>",">+--------------------+>",">+---------------------+>",">+----------------------+>",">+-----------------------+>",">+------------------------+>",">+-------------------------+>",">+--------------------------+>",">+---------------------------+>",">+----------------------------+>",">+-----------------------------+>",">+------------------------------+>"};
int c[N][2];
int cmp(const void *a,const void *b)
{
return **(int (*)[2])a-**(int (*)[2])b;
}
int main(void)
{
int t,n,i,j;
scanf("%d",&t);
while(t--){
scanf("%d",&n);
for(i=0;i<n;++i){
scanf("%d%d",c[i]+0,c[i]+1);
}
qsort(c,n,sizeof(int [2]),cmp);
for(i=0;i<n;++i){
for(j=0;j<c[i][1];++j){
printf("%s\n",array[c[i][0]-2]);
}
printf("\n");
}
}
return 0;
}