Professional Documents
Culture Documents
2.01 ALUNO: Jefferson Nascimento Teixeira de Souza MATRCULA: 09102910 TUTOR: JARBAS CORDEIRO SAMPAIO CURSO: Fsica Licenciatura INCIO
LEIA (n)
NO
n >0
SIM
n=1 NO n=2 NO
SIM
EXIBA(1)
SIM
EXIBA(1, 1) EXIBA(1)
cont3
EXIBA(proximo)
contcont+1
Questo 2:
Algoritmo Ntermos; Variveis: n, maior, totalMaior, menor, somaTotal , cont, totalPos, totalNeg: inteiro; Incio maior0; totalMaior0; menor99999999; somaTotal0; cont0; totalPos0; totalNeg0; Leia(n) numero: vetor[n]; se(n <= 20) ento enquanto(cont < n) faa escreva(Digite o, (cont+1), termo); leia( numero[cont]); somaTotal numero[cont] + somaTotal; se( numero[cont] > maior) ento maior numero[cont]; fim_se se( numero[cont] < menor) ento
menor numero[cont]; fim_se se( numero[cont] > 0) ento totalPos totalPos + 1; fim_se se( numero[cont] <0) ento totalNeg totalNeg + 1; fim_se cont cont + 1; fim_enquanto; escreva("O maior nmero : ", maior); escreva ("O menor nmero : ", menor); escreva ("O soma dos nmeros : ", somaTotal); escreva ("A mdia aritimtica : ", (somaTotal / n)); escreva ("A porcentagem dos nmeros positivos : ", ((totalNumPos*100)/n ), "%"); escreva ("A porcentagem dos nmeros positivos : ", ((totalNumNeg*100)/n ), "%"); fim_se seno escreva( Quantidade de termos informada invalida!); fim_seno Fim