Advertisement
paulogp

Numeros em ambas as direccoes

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