[Plain] Description
There are four numbers that are different from each other, and the output is composed of three numbers that are not repeated.
Input
Four integers are arranged in ascending order.
Output
Output all arrays. The output format is shown in the example.
Sample Input
1 2 3 4
Sample Output
1 2 3
1 3 2
2 1 3
2 3 1
3 1 2
3 2 1
1 2 4
1 4 2
2 1 4
2 4 1
4 1 2
4 2 1
1 3 4
1 4 3
3 1 4
3 4 1
4 1 3
4 3 1
2 3 4
2 4 3
3 2 4
3 4 2
4 2 3
4 3 2
Description
There are four numbers that are different from each other, and the output is composed of three numbers that are not repeated.
Input
Four integers are arranged in ascending order.
Output
Output all arrays. The output format is shown in the example.
Sample Input
1 2 3 4
Sample Output
1 2 3
1 3 2
2 1 3
2 3 1
3 1 2
3 2 1
1 2 4
1 4 2
2 1 4
2 4 1
4 1 2
4 2 1
1 3 4
1 4 3
3 1 4
3 4 1
4 1 3
4 3 1
2 3 4
2 4 3
3 2 4
3 4 2
4 2 3
4 3 2
[Plain] # include <stdio. h>
Int main ()
{
Int I;
Int j;
Int k;
Int num [4];
For (I = 0; I <4; I ++)
{
Scanf ("% d", & num [I]);
}
For (I = 0; I <4; I ++)
{
For (j = 0; j <4; j ++)
{
For (k = 0; k <4; k ++)
{
If (I! = J & I! = K & j! = K & I! = 3 & j! = 3 & k! = 3)
{
Printf ("% d \ n", num [I], num [j], num [k]);
}
}
}
}
For (I = 0; I <4; I ++)
{
For (j = 0; j <4; j ++)
{
For (k = 0; k <4; k ++)
{
If (I! = J & I! = K & j! = K & I! = 2 & j! = 2 & k! = 2)
{
Printf ("% d \ n", num [I], num [j], num [k]);
}
}
}
}
For (I = 0; I <4; I ++)
{
For (j = 0; j <4; j ++)
{
For (k = 0; k <4; k ++)
{
If (I! = J & I! = K & j! = K & I! = 1 & j! = 1 & k! = 1)
{
Printf ("% d \ n", num [I], num [j], num [k]);
}
}
}
}
For (I = 0; I <4; I ++)
{
For (j = 0; j <4; j ++)
{
For (k = 0; k <4; k ++)
{
If (I! = J & I! = K & j! = K & I! = 0 & j! = 0 & k! = 0)
{
Printf ("% d \ n", num [I], num [j], num [k]);
}
}
}
}
Return 0;
}
# Include <stdio. h>
Int main ()
{
Int I;
Int j;
Int k;
Int num [4];
For (I = 0; I <4; I ++)
{
Scanf ("% d", & num [I]);
}
For (I = 0; I <4; I ++)
{
For (j = 0; j <4; j ++)
{
For (k = 0; k <4; k ++)
{
If (I! = J & I! = K & j! = K & I! = 3 & j! = 3 & k! = 3)
{
Printf ("% d \ n", num [I], num [j], num [k]);
}
}
}
}
For (I = 0; I <4; I ++)
{
For (j = 0; j <4; j ++)
{
For (k = 0; k <4; k ++)
{
If (I! = J & I! = K & j! = K & I! = 2 & j! = 2 & k! = 2)
{
Printf ("% d \ n", num [I], num [j], num [k]);
}
}
}
}
For (I = 0; I <4; I ++)
{
For (j = 0; j <4; j ++)
{
For (k = 0; k <4; k ++)
{
If (I! = J & I! = K & j! = K & I! = 1 & j! = 1 & k! = 1)
{
Printf ("% d \ n", num [I], num [j], num [k]);
}
}
}
}
For (I = 0; I <4; I ++)
{
For (j = 0; j <4; j ++)
{
For (k = 0; k <4; k ++)
{
If (I! = J & I! = K & j! = K & I! = 0 & j! = 0 & k! = 0)
{
Printf ("% d \ n", num [I], num [j], num [k]);
}
}
}
}
Return 0;
}