Print? Description
Mr. true
Mr. true is a super Superman who is engaged in competitions in high school and universities, and MS also needs such talents.
So, needless to say, when he goes to the interview, he will get a little bit of privilege, that is, he can leave the team for a while-pretty hr mm will arrange a front position for him.
Input
The first act is an integer T, indicating that there are T groups of data.
Each group has three rows of data:
First, the number of people in the original team is N;
There are n integers separated by spaces in the second line to represent the sequence of original team interview numbers;
The third behavior contains two integers: P and Q. P indicates the interview number obtained by Mr. true, and Q indicates that Mr. true will be inserted into the Q position of the team.
Ensure that no number is the same and N is not greater than 10000
Output
Number of the inserted team interview.
Sample Input
2
3
1 2 3
4 2
4
9 8 2 3
7 1
Sample Output
1 4 2 3
7 9 8 2 3
Description
Mr. true
Mr. true is a super Superman who is engaged in competitions in high school and universities, and MS also needs such talents.
So, needless to say, when he goes to the interview, he will get a little bit of privilege, that is, he can leave the team for a while-pretty hr mm will arrange a front position for him.
Input
The first act is an integer T, indicating that there are T groups of data.
Each group has three rows of data:
First, the number of people in the original team is N;
There are n integers separated by spaces in the second line to represent the sequence of original team interview numbers;
The third behavior contains two integers: P and Q. P indicates the interview number obtained by Mr. true, and Q indicates that Mr. true will be inserted into the Q position of the team.
Ensure that no number is the same and N is not greater than 10000
Output
Number of the inserted team interview.
Sample Input
2
3
1 2 3
4 2
4
9 8 2 3
7 1
Sample Output
1 4 2 3
7 9 8 2 3
[Plain] # include <stdio. h>
Int SUM (int num );
Int main ()
{
Int I;
Int j;
Int n;
Int m;
Int t;
Int k;
Int p;
Int q;
Int num [10001];
Scanf ("% d", & n );
While (n --)
{
Scanf ("% d", & m );
For (I = 0; I <m; I ++)
{
Scanf ("% d", & num [I]);
}
Scanf ("% d", & p, & q );
For (I = 0; I <q; I ++)
{
If (I = q-1)
{
T = num [I];
Num [I] = p;
For (j = I + 1; j <= m; j ++)
{
K = num [j];
Num [j] = t;
T = k;
}
}
}
For (I = 0; I <= m; I ++)
{
Printf ("% d", num [I]);
If (I <m)
{
Printf ("");
}
}
If (n> 0)
{
Printf ("\ n ");
}
}
Return 0;
}
# Include <stdio. h>
Int SUM (int num );
Int main ()
{
Int I;
Int j;
Int n;
Int m;
Int t;
Int k;
Int p;
Int q;
Int num [10001];
Scanf ("% d", & n );
While (n --)
{
Scanf ("% d", & m );
For (I = 0; I <m; I ++)
{
Scanf ("% d", & num [I]);
}
Scanf ("% d", & p, & q );
For (I = 0; I <q; I ++)
{
If (I = q-1)
{
T = num [I];
Num [I] = p;
For (j = I + 1; j <= m; j ++)
{
K = num [j];
Num [j] = t;
T = k;
}
}
}
For (I = 0; I <= m; I ++)
{
Printf ("% d", num [I]);
If (I <m)
{
Printf ("");
}
}
If (n> 0)
{
Printf ("\ n ");
}
}
Return 0;
}