package main
import "fmt"
func xpx(a []int){
for i := 0;i<len(a);i++{
min := a[i]
for j := i+1;j<len(a);j++{
if a[j] < min{
a[i],a[j] = a[j],a[i]
}
}
}
}
func tpx(a []int){
max_a := a[0]
for _,v := range a{
if v > max_a{
max_a = v
}
}
a_l := make([]int,max_a + 1)
for _,v := range a{
a_l[v] += 1
}
for k := 0 ;k<len(a);{
for i:=0;i<len(a_l);i++{
if a_l[i] != 0{
for j:=0;j<a_l[i];j++{
a[k] = i
k ++
}
}
}
}
fmt.Printf("%p\n",a)
}
func ppx(a []int){
for i:=0;i<len(a)-1;i++{
for j:=0;j<len(a)-i-1;j++{
if a[j] < a[j+1]{
a[j],a[j+1] = a[j+1],a[j]
}
}
}
}
func main () {
a := []int{1,2,2,5,3,62,42,556,23}
// xpx(a)
// fmt.Println(a)
// fmt.Printf("%p\n",a)
// tpx(a)
// fmt.Println(a)
// fmt.Printf("%p\n",a)
ppx(a)
fmt.Println(a)
}