第1个回答 2019-06-05
#include
<STDIO.H>
#define
N
10
int
Px(int
num[])
{
int
i,
j;
for
(
i
=
0;
i
<
N;
i++
)
for
(
j
=
0;
j
<
N
-
1
-
i;
j++
)
{
if
(num[j]
<
num[j
+
1])
{
int
temp;
temp
=
num[j];
num[j]
=
num[j
+
1];
num[j
+
1]
=
temp;
}
}
}
main()
{
int
num[N],
i;
printf
("Please
input
the
numbers:
");
for
(
i
=
0;
i
<
N;
i++
)
{
scanf
("%d",
&num[i]);
}
Px(&num);
for
(
i
=
0;
i
<
N;
i++
)
{
printf
("%d
",
num[i]);
}
}