Just random mumbling
Time pass to be honest,may work as a reference later,I am not sure.
Thursday, October 20, 2022
Sorting array of numbers in perl
@numbers
=
(
13
,
9
,
22
,
27
,
1
,
3
,
-4
,
10
);
print
"Original:
@numbers
\n\n"
;
@sorted_numbers
=
sort
{
$a
<=>
$b
}
@numbers;
print
"After sorting:
@sorted_numbers
"
;
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment