3
I wanted to know about this code:
Algoritmo "Brincadeira2Ou1 "
Var A, C, P: inteiro
Inicio
A <- 0
C <- 0
P <- 0
escreval ("(=====================2===OU===1=====================)")
escreval ("Insira o número do (A)ndré: ")
leia (A)
enquanto (A <= 1) ou (A >= 2) faca
escreval ("Número inválido! Número deve ser 1 ou 2")
escreval ("Por favor, digite novamente um número para André:")
leia (A)
fimenquanto
There in the structure of enquanto (A <= 1) ou (A >= 2)
, when I do the A
receive 1 or 2, it keeps returning the line of escreval
that the Número é inválido
, being that it needs to be 1 or 2 (even if I type 1 or 2 the system comes back as invalid number).
The moment I withdraw the =
, the wheel code validating the 1 or 2 I entered. It wouldn’t be right to be Less than or equal to 1 or A greater than or equal to 2 than the Less than 1 or A greater than 2?
Thank you very much for your reply! I realized that I was not making much sense, I need to improve yet and much, one day I get there. In this case I also saw that connectives make a huge difference. I ended up choosing A <> 1 with connective E. This Pseudo with Visualg that I’m doing is the "game" of 2 or 1, between 3 people, which gives equal numbers of the draw, a different win and so on. Thank you very much again.
– Fellipems