think pascal
program seno3; (*funzioni trigonometriche*) var seno, coseno, radianti: real; is, ic, a: integer;
procedure pausa; begin writeln('premi return'); readln; end;
begin penpat(black); for a := 0 to 360 do begin radianti := a * 3.14 / 90; seno := sin(radianti); coseno := cos(radianti); is := trunc(50 * seno); ic := trunc(60 * coseno);
drawline(a, 150, a, 150 + is); drawline(a, 150, a, 150 + ic); end; pausa; end.
program GRAFICA1; (*funzioni grafiche come con INSTANT PASCAL *) (*attivare finestra drawing completa*)
procedure cancella; begin penpat(white); paintrect(0, 0, 200, 200); end;
procedure pausa; begin writeln('premi return per proseguire'); readln; end;
begin penpat(black); paintcircle(100, 50, 30); pausa; paintrect(10, 110, 60, 220); framerect(120, 120, 160, 160); pausa; paintoval(30, 30, 80, 80); frameoval(140, 140, 180, 180); pausa; end.
program trigo14a; {istogrammi con tratteggio verticale} {scala automatica per asse ordinate y} var k, s, y1, x1, valori, b, a, tipo, totale, y: integer; assex, MAX: integer; scalay: real; begin writeln('indica ampiezza istogramma='); readln(k); writeln('indica dato massimo'); readln(max); y1 := 250; scalay := y1 / max; assex := 500; totale := round(assex / k); writeln('valori possibile <=', totale); writeln('indica numero valori='); readln(valori); s := 1; x1 := 10; tipo := 5; for A := 1 to VALORI do begin write('dato='); readln(y); framerect(y1, x1, round(y1 - y * scalay), x1 + k); for b := 1 to k do begin drawline(x1 + b, y1, x1 + b, round(y1 - y * scalay)); b := b + s; end; x1 := x1 + k; s := s + 1; if s > tipo then s := 1; end; WRITELN('premi return'); readln; end.program proge2; var a, b, c: integer; begin a := 5; b := 6; c := a * b; writeln(a, b, c); readln; end.