20.03.2015 Views

Prova - Webdesign - Central de Concursos

Prova - Webdesign - Central de Concursos

Prova - Webdesign - Central de Concursos

SHOW MORE
SHOW LESS

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

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

<strong>Prova</strong> Objetiva | <strong>Web<strong>de</strong>sign</strong><br />

54<br />

Observe o trecho <strong>de</strong> pseudocódigo abaixo para or<strong>de</strong>nar 9<br />

números, em or<strong>de</strong>m crescente.<br />

algoritmo SORT;<br />

tipo<br />

VETOR = array[1..9] numérico;<br />

variáveis<br />

T : VETOR;<br />

K, X, B : numérico;<br />

Início {corpo principal do programa}<br />

{instruções que realizam a leitura}<br />

{dos 9 números <strong>de</strong>sor<strong>de</strong>nados}<br />

{classificação dos 9 números}<br />

{em or<strong>de</strong>m crescente}<br />

BLOCO-INSTRUÇÕES<br />

{impressão dos 9 números}<br />

{em or<strong>de</strong>m crescente}<br />

fim-do-algoritmo.<br />

As instruções que <strong>de</strong>vem substituir a referência<br />

BLOCO-INSTRUÇÕES estão indicadas na seguinte opção:<br />

55<br />

Observe o pseudocódigo abaixo, referente à multiplicação <strong>de</strong><br />

matrizes A 3x5 por B 5x4 e que armazena o resultado na matriz C.<br />

As instruções que <strong>de</strong>vem substituir o bloco<br />

(A)<br />

estão indicadas na<br />

seguinte alternativa:<br />

PARA I DE 1 ATÉ 5 FAÇA<br />

PARA J DE 1 ATÉ 4 FAÇA<br />

(A)<br />

PARA K DE 1 ATÉ 3 FAÇA<br />

ATRIBUIR C[I,J] + A[I,K] * B[K,J] A C[I,J];<br />

(B)<br />

(B)<br />

(C)<br />

PARA I DE 1 ATÉ 5 FAÇA<br />

PARA J DE 1 ATÉ 3 FAÇA<br />

PARA K DE 1 ATÉ 5 FAÇA<br />

ATRIBUIR C[I,J] + A[I,K] * B[K,J] A C[I,J];<br />

PARA I DE 1 ATÉ 4 FAÇA<br />

PARA J DE 1 ATÉ 3 FAÇA<br />

PARA K DE 1 ATÉ 5 FAÇA<br />

ATRIBUIR C[I,J] + A[I,K] * B[K,J] A C[I,J];<br />

(C)<br />

(D)<br />

(E)<br />

PARA I DE 1 ATÉ 3 FAÇA<br />

PARA J DE 1 ATÉ 4 FAÇA<br />

PARA K DE 1 ATÉ 4 FAÇA<br />

ATRIBUIR C[I,J] + A[I,K] * B[K,J] A C[I,J];<br />

PARA I DE 1 ATÉ 3 FAÇA<br />

PARA J DE 1 ATÉ 5 FAÇA<br />

PARA K DE 1 ATÉ 4 FAÇA<br />

ATRIBUIR C[I,J] + A[I,K] * B[K,J] A C[I,J];<br />

(D)<br />

(E)<br />

11

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

Saved successfully!

Ooh no, something went wrong!