11.07.2015 Views

Lista 03a - DCC/UFMG

Lista 03a - DCC/UFMG

Lista 03a - DCC/UFMG

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

29) Escreva um algoritmo em PORTUGOL que receba 15 números e imprima quantosnúmeros maiores que 30 foram digitados.algoritmo L3P029;varinteiro: C, N30;real: VALOR;inícioN30 ← 0;para C de 1 até 15 façaleia(VALOR);se ( VALOR > 30 ) entãoN30 ← N30 + 1;fim-sefim-paraimprima("A quantidade de números maiores que 30 digitados: ",N30);fimprogram l3p029;varC, N30: integer;VALOR: real;beginN30 := 0;for C := 1 to 15 dobeginwrite('Digite um numero: ');readLn(VALOR);if ( VALOR > 30 )then N30 := N30 + 1;end;writeLn('A quantidade de numeros maiores que 30 digitados: ',N30);end.N30 = 0;for C = 1 : 15VALOR = input('Digite um numero: ');if ( VALOR > 30 )N30 = N30 + 1;endendfprintf(1,'A quantidade de numeros maiores que 30 digitados: %d\n',N30);<strong>UFMG</strong> – ICEx – <strong>DCC</strong> – Programação de Computadores – 2º. Sem 2005 – David Menoti 29

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!