It's also a big question... The name of hangdian is not false...
But I still want to follow the footsteps of E. star...
[Cpp]
# Include <cstdio>
# Include <algorithm>
# Define MAXN 35
Using namespace std;
Struct S {
Int n, l;
};
Bool cmp (S a, S B)
{
Return a. l <B. l;
}
Int main ()
{
Int t, n;
S s [MAXN];
Scanf ("% d", & t );
While (t --)
{
Scanf ("% d", & n );
For (int I = 0; I <n; I ++)
Scanf ("% d", & s [I]. l, & s [I]. n );
Sort (s, s + n, cmp );
For (int I = 0; I <n; I ++)
{
For (int k = 0; k <s [I]. n; k ++)
{
Printf ("> + ");
For (int j = 0; j <s [I]. l-2; j ++)
Printf ("-");
Printf ("+> \ n ");
}
Printf ("\ n ");
}
}
Return 0;
}
# Include <cstdio>
# Include <algorithm>
# Define MAXN 35
Using namespace std;
Struct S {
Int n, l;
};
Bool cmp (S a, S B)
{
Return a. l <B. l;
}
Int main ()
{
Int t, n;
S s [MAXN];
Scanf ("% d", & t );
While (t --)
{
Scanf ("% d", & n );
For (int I = 0; I <n; I ++)
Scanf ("% d", & s [I]. l, & s [I]. n );
Sort (s, s + n, cmp );
For (int I = 0; I <n; I ++)
{
For (int k = 0; k <s [I]. n; k ++)
{
Printf ("> + ");
For (int j = 0; j <s [I]. l-2; j ++)
Printf ("-");
Printf ("+> \ n ");
}
Printf ("\ n ");
}
}
Return 0;
}