Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ALGORITMO "3nomes"
- // Disciplina : [Algoritmos e Programa莽茫o Estruturada]
- // Professor : Wesley Viana Pereira
- // Descri莽茫o : Algoritmo que coleta e exibe 3 nomes
- // Autor(a) : Jaco de Souza Freitas
- // Data atual : 01/08/2022
- VAR
- nomes: VETOR[1..3] DE CARACTER
- qtdNomes: INTEIRO
- INICIO
- qtdNomes <- 1
- // Solicita 3 nomes ao usuaio e se não vazio, os coloca no vetor
- ENQUANTO (qtdNomes <= 3) FAÇA
- ESCREVA("Digite o ", qtdNomes, "A nome: ")
- LEIA(nomes[qtdNomes])
- SE nomes[qtdNomes] = "" ENTÃO
- ESCREVAL("Digite um nome válido.")
- SENAO
- qtdNomes <- qtdNomes + 1
- FIMSE
- FIMENQUANTO
- ESCREVAL("")
- ESCREVAL("===== Nomes Digitados =====")
- ESCREVAL("Nome 1: ", nomes[1])
- ESCREVAL("Nome 2: ", nomes[2])
- ESCREVAL("Nome 3: ", nomes[3])
- FIMALGORITMO
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement