Advertisement
paulogp

Numeros em triangulo (v. 1.0.1)

Aug 7th, 2011
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.74 KB | None | 0 0
  1. { paulogp }
  2. { mac os 7 }
  3. program Ada11p;
  4.  
  5. uses
  6.     MemTypes, QuickDraw, OSIntf;
  7.  
  8. var
  9.     i, j, n: integer;
  10.     fim: string;
  11.  
  12. begin
  13.     repeat
  14.         clearscreen;
  15.         writeln('Programa: Escreve números em triângulo!');
  16.         writeln('Paulo G.P.');
  17.         writeln('=======================================');
  18.         repeat
  19.             writeln;
  20.             write('Introduza um valor no intervalo ]0,20]: ');
  21.             readln(n);
  22.             writeln;
  23.             If (n <= 0) or (n > 20)  then write('Atenção!!!');
  24.         until (n > 0) and (n <= 20);
  25.         writeln;
  26.         for j:= 1 to n do
  27.         begin
  28.             for i:= 1 to n do
  29.             if i <= n - j + 1 then write('   ', i);
  30.             writeln;
  31.         end;
  32.         writeln;
  33.         writeln;  
  34.         writeln;
  35.         write('Repetir programa (S/N): ');
  36.         readln(fim);
  37.         uprstring(fim, true);
  38.     until fim = 'N';
  39. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement