Advertisement
jacodesouza

Untitled

Aug 31st, 2022
1,073
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
E 0.94 KB | Writing | 0 0
  1. ALGORITMO "3nomes"
  2. // Disciplina   : [Algoritmos e Programa莽茫o Estruturada]
  3. // Professor   : Wesley Viana Pereira
  4. // Descri莽茫o   : Algoritmo que coleta e exibe 3 nomes
  5. // Autor(a)    : Jaco de Souza Freitas
  6. // Data atual  : 01/08/2022
  7. VAR
  8.    nomes: VETOR[1..3] DE CARACTER
  9.    qtdNomes: INTEIRO
  10. INICIO
  11.       qtdNomes <- 1
  12.  
  13.       // Solicita 3 nomes ao usuaio e se não vazio, os coloca no vetor
  14.       ENQUANTO (qtdNomes <= 3) FAÇA
  15.                ESCREVA("Digite o ", qtdNomes, "A nome: ")
  16.                LEIA(nomes[qtdNomes])
  17.  
  18.                SE nomes[qtdNomes] = "" ENTÃO
  19.                        ESCREVAL("Digite um nome válido.")
  20.                SENAO
  21.                     qtdNomes <- qtdNomes + 1
  22.                FIMSE
  23.       FIMENQUANTO
  24.  
  25.       ESCREVAL("")
  26.       ESCREVAL("===== Nomes Digitados =====")
  27.       ESCREVAL("Nome 1: ", nomes[1])
  28.       ESCREVAL("Nome 2: ", nomes[2])
  29.       ESCREVAL("Nome 3: ", nomes[3])
  30. FIMALGORITMO
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement