Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- { paulogp }
- Program Peda_01; {Desenha, usando asteriscos, um rectângulo.}
- Uses
- WinCrt;
- Const
- Max_Comp=79;
- Max_Larg=22;
- Var
- Cont_A,Cont_B,Comp_Rect,Larg_Rect: Integer;
- Tecla: Char;
- Begin
- Repeat
- ClrScr;
- WriteLn('Desenho de rectangulo!');
- WriteLn('~~~~~~~~~~~~~~~~~~~~~~');
- WriteLn('Programado por: Paulo G.P');
- WriteLn;
- Repeat
- WriteLn;
- Write('Comprimento do rectangulo: ');
- ReadLn(Comp_Rect);
- If Comp_Rect<=0 then WriteLn('O valor tem de ser maior que "0"!');
- If Comp_Rect>Max_Comp then WriteLn('O valor tem de ser menor que "',Max_Comp,'"!');
- Until (Comp_Rect>0) and (Comp_Rect<Max_Comp);
- Repeat
- WriteLn;
- Write('Largura do rectangulo: ');
- ReadLn(Larg_Rect);
- If Larg_Rect<=0 then WriteLn('O valor tem de ser maior que "0"!');
- If Larg_Rect>Max_Larg then WriteLn('O valor tem de ser menor que "',Max_Larg,'"!');
- Until (Larg_Rect>0) and (Larg_Rect<Max_Larg);
- WriteLn;
- For Cont_A:=1 to Larg_Rect do
- Begin
- WriteLn;
- For Cont_B:=1 to Comp_Rect do Write('*');
- End;
- WriteLn;
- WriteLn;
- Write('Repetir o programa (s/n)? ');
- Tecla:=ReadKey;
- Until (Tecla='N') or (Tecla='n');
- DoneWinCrt;
- End.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement