AULAS 23 - 08/07/11 , 24 - 04/08/211 e 25 - 11/08/11 - Exercicios e mais exercícios
Autor: Jefferson Figueiredo | Publicado: 2011-08-15T15:47:00-07:00

<!--[if gte mso 9]>     Normal   0         21         false   false   false      PT-BR   X-NONE   X-NONE                                                     MicrosoftInternetExplorer4                                                   <![endif]--><!--[if gte mso 9]>  <w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
  DefSemiHidden="true" DefQFormat="false" DefPriority="99"
  LatentStyleCount="267">   <w:LsdException Locked="false" Priority="0" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Normal"/>   <w:LsdException Locked="false" Priority="9" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>                                                         <w:LsdException Locked="false" Priority="10" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Title"/>      <w:LsdException Locked="false" Priority="11" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>   <w:LsdException Locked="false" Priority="22" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Strong"/>   <w:LsdException Locked="false" Priority="20" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>   <w:LsdException Locked="false" Priority="59" SemiHidden="false"
   UnhideWhenUsed="false" Name="Table Grid"/>      <w:LsdException Locked="false" Priority="1" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>   <w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading"/>   <w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List"/>   <w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid"/>   <w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1"/>   <w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2"/>   <w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1"/>   <w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2"/>   <w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1"/>   <w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2"/>   <w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3"/>   <w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List"/>   <w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading"/>   <w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List"/>   <w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid"/>   <w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 1"/>   <w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 1"/>   <w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 1"/>   <w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>   <w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>   <w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>      <w:LsdException Locked="false" Priority="34" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>   <w:LsdException Locked="false" Priority="29" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Quote"/>   <w:LsdException Locked="false" Priority="30" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>   <w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>   <w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>   <w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>   <w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>   <w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 1"/>   <w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>   <w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 1"/>   <w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>   <w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 2"/>   <w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 2"/>   <w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 2"/>   <w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>   <w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>   <w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>   <w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>   <w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>   <w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>   <w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>   <w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 2"/>   <w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>   <w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 2"/>   <w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>   <w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 3"/>   <w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 3"/>   <w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 3"/>   <w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>   <w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>   <w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>   <w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>   <w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>   <w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>   <w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>   <w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 3"/>   <w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>   <w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 3"/>   <w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>   <w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 4"/>   <w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 4"/>   <w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 4"/>   <w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>   <w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>   <w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>   <w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>   <w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>   <w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>   <w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>   <w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 4"/>   <w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>   <w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 4"/>   <w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>   <w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 5"/>   <w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 5"/>   <w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 5"/>   <w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>   <w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>   <w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>   <w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>   <w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>   <w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>   <w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>   <w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 5"/>   <w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>   <w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 5"/>   <w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>   <w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 6"/>   <w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 6"/>   <w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 6"/>   <w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>   <w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>   <w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>   <w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>   <w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>   <w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>   <w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>   <w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 6"/>   <w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>   <w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 6"/>   <w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>   <w:LsdException Locked="false" Priority="19" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>   <w:LsdException Locked="false" Priority="21" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>   <w:LsdException Locked="false" Priority="31" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>   <w:LsdException Locked="false" Priority="32" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>   <w:LsdException Locked="false" Priority="33" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>         <![endif]--><!--[if gte mso 10]> 
 /* Style Definitions */
 table.MsoNormalTable
	{mso-style-name:"Tabela normal";
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-priority:99;
	mso-style-qformat:yes;
	mso-style-parent:"";
	mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
	mso-para-margin-top:0cm;
	mso-para-margin-right:0cm;
	mso-para-margin-bottom:10.0pt;
	mso-para-margin-left:0cm;
	line-height:115%;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:"Times New Roman";
	mso-fareast-theme-font:minor-fareast;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;}
 <![endif]-->  
&nbsp;&nbsp; Segue abaixo os exercícios apresentados nas aulas 23, 24 e 25:

6 - Crie um programa que preencha uma primeira matriz de ordem 4x5 e uma segunda matriz 5x2. O programa deverá, também, calcular e mostrar a matriz resultante do produto matricial das duas matrizes anteriores, armazenando-o em uma terceira matriz de ordem 4x2.

algoritmo "questao6"
var
&nbsp; &nbsp;mat1:vetor[1..4,1..5] de real
&nbsp; &nbsp;mat2:vetor[1..5,1..2] de real
&nbsp; &nbsp;res:vetor[1..5,1..2] de real
&nbsp; &nbsp;l,c: inteiro
inicio
&nbsp; &nbsp; &nbsp; para l de 1 ate 4 faca
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;para c de 1 ate 5 faca
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; escreval("digite o numero da linha",l," e coluna ",c,":")
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; leia(mat1[l,c])
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fimpara
&nbsp; &nbsp; &nbsp; fimpara
&nbsp; &nbsp; &nbsp; para l de 1 ate 5 faca
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;para c de 1 ate 2 faca
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; escreval("digite o numero da linha",l," e coluna ",c,", da segunda matriz:")
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; leia(mat2[l,c])
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fimpara
&nbsp; &nbsp; &nbsp; fimpara
&nbsp; &nbsp; &nbsp; para l de 1 ate 4 faca
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;para c de 1 ate 2 faca
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; res[l,c]&lt;- ((mat1[l,1]*mat2[1,c])+(mat1[l,2]*mat2[2,c])+(mat1[l,3]*mat2[3,c])+(mat1[l,4]*mat2[4,c])+(mat1[l,5]*mat2[5,c]))
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fimpara
&nbsp; &nbsp; &nbsp; fimpara
&nbsp; &nbsp; &nbsp; para l de 1 ate 4 faca
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;para c de 1 ate 2 faca
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; escreval (res[l,1]," |",res[l,2])
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fimpara
&nbsp; &nbsp; &nbsp; fimpara
fimalgoritmo


7 - Um elemento Aij de uma matriz é dito ponto de sela da matriz A se, e somente se , Aij for ao mesmo tempo o menor elemento da linha i e o maior elemento da coluna j. Faça um programa que carregue uma matriz de ordem 5x7, verifique se a matriz possui ponto de sela e , se possuir, mostre seu valor e sua localização.

algoritmo "ponto_de_sela7"
var
&nbsp; &nbsp;matr:vetor[1..5,1..7] de real
&nbsp; &nbsp;l,c,l2,cont,conta,lin,co: inteiro
&nbsp; &nbsp;sela:real
inicio
&nbsp; &nbsp; &nbsp; para l de 1 ate 5 faca
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;para c de 1 ate 7 faca
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; escreval("digite o numero referente a linha",l," e coluna",c,":")
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; leia(matr[l,c])
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fimpara
&nbsp; &nbsp; &nbsp; fimpara
&nbsp; &nbsp; &nbsp; conta&lt;-0
&nbsp; &nbsp; &nbsp; para l de 1 ate 5 faca
&nbsp; &nbsp; &nbsp; sela&lt;- matr[l,1]
&nbsp; &nbsp; &nbsp; lin&lt;- l
&nbsp; &nbsp; &nbsp; co&lt;- 1
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;para c de 1 ate 7 faca
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; se sela &gt; matr[l,c] entao
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sela&lt;- matr[l,c]
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;lin&lt;- l
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;co&lt;- c
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fimse
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fimpara
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cont&lt;-0
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;para l2 de 1 ate 5 faca
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; se sela &lt;= matr[l2,co] entao
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;se (l2&lt;&gt;lin) e (c&lt;&gt;co) entao
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cont&lt;- cont+1
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fimse
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fimse
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fimpara
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;se cont = 0 entao
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; escreval(" ")
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; escreval("o ponto de sela da matriz esta na linha",lin,", e na coluna",co," e tem valor",matr[lin,co],".")
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; conta&lt;- conta+1
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fimse
&nbsp; &nbsp; &nbsp; fimpara
&nbsp; &nbsp; &nbsp; se conta = 0 entao
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;escreval(" ")
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;escreval("essa matriz não tem nenhum ponto de sela.")
&nbsp; &nbsp; &nbsp; fimse
fimalgoritmo8 - Elabore um programa que preencha uma matriz de 6x4 com números inteiros, cacule e mostre quantos elementos dessa matriz são maiores que 30 e, em seguida, monte uma segunda matriz com os elementos diferentes de 30. No lugar do número 30 da segunda matriz, coloque o número zero.

algoritmo "quest8"
var
&nbsp; &nbsp;matr: vetor[1..6,1..4] de inteiro
&nbsp; &nbsp;l,c,cont:inteiro
inicio
&nbsp; &nbsp; &nbsp; cont&lt;-0
&nbsp; &nbsp; &nbsp; para l de 1 ate 6 faca
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;para c de 1 ate 4 faca
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; escreval("digite o numero referente a linha",l," e coluna",c,":")
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; leia (matr[l,c])
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; se (matr[l,c] &gt; 30) entao
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cont&lt;- cont +1
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fimse
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; se matr[l,c] = 30 entao
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;matr[l,c] &lt;- 0
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fimse
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fimpara
&nbsp; &nbsp; &nbsp; fimpara
&nbsp; &nbsp; &nbsp; escreval("a matriz tem ",cont," numeros maiores que 30.")
&nbsp; &nbsp; &nbsp; para l de 1 ate 6 faca
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;para c de 1 ate 4 faca
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; escreva(" | ",matr[l,c])
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fimpara
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;escreval(" |")
&nbsp; &nbsp; &nbsp; fimpara
fimalgoritmo

9 - Crie um programa que preencha uma matriz 15 x 5 com números inteiros, calcule e mostre quais elementos da matriz se repetem e quantas veses cada um se repete.


10 - Elabore um programa que preencha uma matriz 10 x 10 com números inteiros, execute as trocas especificadas a seguir e mostre a matriz resultante:
- A linha 2 com a linha 8;
- A coluna 4 com a coluna 10;
- A diagonal principal com a diagonal secundária;
- A linha 5 com a coluna 10.

algoritmo "trocas"
var
&nbsp; &nbsp;matr:vetor[1..10,1..10] de real
&nbsp; &nbsp;matr2:vetor[1..10,1..10] de real
&nbsp; &nbsp;l,c,c2:inteiro
inicio
&nbsp; &nbsp; &nbsp; para l de 1 ate 10 faca
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;para c de 1 ate 10 faca
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; escreval("digite o número referente a linha",l," e coluna",c,":")
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; leia(matr[l,c])
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; matr2[l,c] &lt;- matr[l,c]
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fimpara
&nbsp; &nbsp; &nbsp; fimpara
&nbsp; &nbsp; &nbsp; c2&lt;-10
&nbsp; &nbsp; &nbsp; para l de 1 ate 10 faca
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;matr2[2,l] &lt;- matr[8,l]
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;matr2[8,l] &lt;- matr[2,l]
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;matr2[l,4] &lt;- matr[l,10]
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;matr2[l,10] &lt;- matr[l,4]
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;matr2[l,l] &lt;- matr[l,c2]
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;matr2[l,c2] &lt;- matr[l,l]
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;c2 &lt;- c2-1
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;matr2[5,l] &lt;- matr[l,10]
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;matr2[l,10] &lt;- matr[5,l]
&nbsp; &nbsp; &nbsp; fimpara
&nbsp; &nbsp; &nbsp; escreval(" &nbsp;matriz final ")
&nbsp; &nbsp; &nbsp; para l de 1 ate 10 faca
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;escreval("| ",matr2[l,1]," | ",matr2[l,2]," | ",matr2[l,3]," | ",matr2[l,4]," | ",matr2[l,5]," | ",matr2[l,6]," | ",matr2[l,7]," | ",matr2[l,8]," | ",matr2[l,9]," | ",matr2[l,10]," | ")
&nbsp; &nbsp; &nbsp; fimpara
fimalgoritmo

1&nbsp;- Leia um conjunto com n números e informe se existe algum elemento repetido no conjunto.2&nbsp;- Leia uma matriz quadrada de ordem 10 e calcule a sua transposta. Imprima as duas matrizes.
algoritmo "transposta"
var
&nbsp; &nbsp;matr:vetor[1..10,1..10] de real
&nbsp; &nbsp;matr2:vetor[1..10,1..10] de real
&nbsp; &nbsp;l,c:inteiro
inicio
&nbsp; &nbsp; &nbsp; para l de 1 ate 10 faca
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;para c de 1 ate 10 faca
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; escreval("digite o valor referente a linha ",l," e coluna ",c,":")
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; leia(matr[l,c])
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fimpara
&nbsp; &nbsp; &nbsp; fimpara
&nbsp; &nbsp; &nbsp; para l de 1 ate 10 faca
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;para c de 1 ate 10 faca
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; matr2[l,c] &lt;- matr[c,l]
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fimpara
&nbsp; &nbsp; &nbsp; fimpara
&nbsp; &nbsp; &nbsp; escreval(" matriz original ")
&nbsp; &nbsp; &nbsp; para l de 1 ate 10 faca
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; escreval("| ",matr[l,1]," | ",matr[l,2]," | ",matr[l,3]," | ",matr[l,4]," | ",matr[l,5]," | ",matr[l,6]," | ",matr[l,7]," | ",matr[l,8]," | ",matr[l,9]," | ",matr[l,10]," | ")
&nbsp; &nbsp; &nbsp; fimpara
&nbsp; &nbsp; &nbsp; escreval(" ")
&nbsp; &nbsp; &nbsp; escreval(" matriz transposta ")
&nbsp; &nbsp; &nbsp; para l de 1 ate 10 faca
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; escreval("| ",matr2[l,1]," | ",matr2[l,2]," | ",matr2[l,3]," | ",matr2[l,4]," | ",matr2[l,5]," | ",matr2[l,6]," | ",matr2[l,7]," | ",matr2[l,8]," | ",matr2[l,9]," | ",matr2[l,10]," | ")
&nbsp; &nbsp; &nbsp; fimpara
fimalgoritmo
3&nbsp;- Ler uma matriz 6 x 6 e atribuir o valor 0 para os valores negativos encontrados fora das diagonais principal e secundaria
algoritmo "diagonais"
var
&nbsp; &nbsp;matr:vetor[1..6,1..6] de real
&nbsp; &nbsp;l,c,h:inteiro
inicio
&nbsp; &nbsp; &nbsp; para l de 1 ate 6 faca
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;para c de 1 ate 6 faca
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; escreval("digite o número referente a linha",l," e coluna",c,":")
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; leia(matr[l,c])
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fimpara
&nbsp; &nbsp; &nbsp; fimpara
&nbsp; &nbsp; &nbsp; h&lt;-6
&nbsp; &nbsp; &nbsp; para l de 1 ate 6 faca
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;para c de 1 ate 6 faca
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; se (l&lt;&gt;c) e (c&lt;&gt;h) e (matr[l,c]&lt;0) entao
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; matr[l,c] &lt;- 0
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fimse
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fimpara
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;h&lt;- h-1
&nbsp; &nbsp; &nbsp; fimpara
&nbsp; &nbsp; &nbsp; escreval(" matriz final ")
&nbsp; &nbsp; &nbsp; para l de 1 ate 6 faca
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;escreval(" | ",matr[l,1]," | ",matr[l,2]," | ",matr[l,3]," | ",matr[l,4]," | ",matr[l,5]," | ",matr[l,6]," | ")
&nbsp; &nbsp; &nbsp; fimpara
fimalgoritmo
4&nbsp;- Leia matriz A de 8x8, depois preencha uma matriz B de mesma ordem, trocando as linhas da matriz A pelas colunas da matriz B. Exemplo: 1ª linha da matriz A, será a 1ª coluna da matriz B2ª linha da matriz A, será a 2ª coluna da matriz Be assim por diante. Escreva a matriz resultante.

algoritmo "linha_colu"
var
&nbsp; &nbsp;matr:vetor[1..8,1..8] de real
&nbsp; &nbsp;matr2:vetor[1..8,1..8] de real
&nbsp; &nbsp;l,c:inteiro
inicio
&nbsp; &nbsp; &nbsp; para l de 1 ate 8 faca
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;para c de 1 ate 8 faca
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; escreval("digite o valor referente a linha ",l," e coluna ",c,":")
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; leia(matr[l,c])
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fimpara
&nbsp; &nbsp; &nbsp; fimpara
&nbsp; &nbsp; &nbsp; para l de 1 ate 8 faca
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;para c de 1 ate 8 faca
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; matr2[l,c] &lt;- matr[c,l]
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fimpara
&nbsp; &nbsp; &nbsp; fimpara
&nbsp; &nbsp; &nbsp; escreval(" ")
&nbsp; &nbsp; &nbsp; escreval(" matriz resultante ")
&nbsp; &nbsp; &nbsp; para l de 1 ate 8 faca
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; escreval("| ",matr2[l,1]," | ",matr2[l,2]," | ",matr2[l,3]," | ",matr2[l,4]," | ",matr2[l,5]," | ",matr2[l,6]," | ",matr2[l,7]," | ",matr2[l,8]," | ")
&nbsp; &nbsp; &nbsp; fimpara
fimalgoritmo

Tive bastante dificuldade na resolução de alguns dos exercícios, agora é se preparar para a prova.
&nbsp;