Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- { paulogp }
- Program Peda_04; {Desenha dois triangulos rectangulos}
- Uses
- WinCrt;
- Var
- X,Y,Altura,Base: Integer;
- Tecla: Char;
- Begin
- Repeat
- ClrScr;
- WriteLn('Triangulos!');
- WriteLn('~~~~~~~~~~~');
- WriteLn('Programado por: Paulo G.P.');
- WriteLn;
- WriteLn;
- Write('Introduza o valor da base: ');
- ReadLn(Base);
- WriteLn;
- Write('Introduza o valor da altura: ');
- ReadLn(Altura);
- ClrScr;
- WriteLn('A desenhar triangulos!');
- For Y:=1 to Altura do
- Begin
- WriteLn;
- Write(' ':25);
- For X:=1 to Base do
- If Y>=((-Altura/Base)*X+Altura) then write('*') else write(' ');
- End;
- WriteLn;
- For Y:=1 to Altura do
- Begin
- WriteLn;
- Write(' ':25);
- For X:=1 to Base do
- If Y>=((-Altura/Base)*X+Altura) then 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