Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- { paulogp }
- { mac os 7 }
- program Ada10p;
- uses
- MemTypes, QuickDraw, OSIntf;
- var
- i, j, n: integer;
- fim: string;
- begin
- repeat
- clearscreen;
- writeln('Programa: Matriz Identidade!');
- writeln('============================');
- repeat
- writeln;
- write('Introduza um valor no intervalo ]0,20]: ');
- readln(n);
- writeln;
- if (n <= 0) or (n > 20) then write('Atenção!!!');
- until (n > 0) and (n <= 20);
- writeln;
- for j:= 1 to n do
- begin
- for i:= 1 to n - 1 do
- begin
- if (i = j) then write(' 1');
- write(' 0');
- end;
- if (j = n) then write(' 1') else writeln;
- end;
- writeln;
- writeln;
- write('Repetir programa (S/N): ');
- readln(fim);
- uprstring(fim, true);
- until fim = 'N';
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement