0
People who can help me I am extremely grateful, I’m trying to build an algorithm that orders 3 real numerical values in ascending order, but not how to deal with decimal numbers in the algorithm...
var
num: vetor[1..3] de inteiro
i, j, aux: inteiro
Inicio
para i de 1 ate 3 passo 1 faca
escreva ("Informe um número:")
leia (num[i])
fimpara
para i de 1 ate 2 passo 1 faca
para j de i+1 ate 3 faca
se (num[i] > num[j]) entao
aux <- num[i]
num[i] <- num[j]
num[j] <- aux
fimse
fimpara
fimpara
para i de 1 ate 3 passo 1 faca
escreva (num[i])
fimpara
Fimalgoritmo
What environment are you programming in?
– RXSD
Being more specific, it is a work of the faculty, I am using Portugol (structured Portuguese). In other programming languages you could use the Sort() command, but since it does not exist in portugol I need to build something for this purpose.
– user150382