# data[].attributes.body
program n_factorial;{antet}

{blocul de declaratii si
definitii:}
var
n,i,fac:integer;

{corpul programului:}
begin
write('Introduceti  N ');
readln(n);

fac:=1;{initializare}

{ciclu for pentru calculare
factorial:}
for i:=1 to n do
fac:=fac*i;

writeln('N factorial ',fac);
{afisare total numere
negative}

readln;
end.

# data[].attributes.headline
Programul ce urmează afișează pe ecran numerele de ordine ale valorilor tipurilor dedate Studii și Raspuns.

# data[].attributes.subject
Programul ce urmează afișează pe ecran numerele de ordine ale valorilor tipurilor dedate Studii și Raspuns.

# data[].attributes.body
Program P16; { Tipul de date Studii si Raspuns} type Studii = (Elementare, Medii, Superioare); Raspuns = (Nu, Da); var i : integer; {numar de ordine} begin i:=ord(Elementare); writeln(i); i:=ord(Medii); writeln(i); i:=ord(Superioare); writeln(i); i:=ord(Nu); writeln(i); i:=ord(Da); writeln(i); end.

# data[].attributes.body
Program bolean ;

{Operatii cu date de tip

boolean }

var x, y, z : boolean;

begin

x:=false; y:=false;

writeln(’x=’, x, ’y=’, y);

z:=not x;

writeln(’not x = ’, z);

z:=x and y;

writeln(’x and y = ’, z);

z:=x or y;

writeln(’x or y = ’, z);

writeln;

x:=false; y:=true;

writeln(’x=’, x, ’y=’, y);

z:=not x;

writeln(’not x = ’, z);

z:=x and y;

writeln(’x and y = ’, z);

z:=x or y;

writeln(’x or y = ’, z);

writeln;

x:=true; y:=false;

writeln(’x=’, x, ’y=’, y);

z:=not x;

writeln(’not x = ’, z);

z:=x and y;

writeln(’x and y = ’, z);

z:=x or y;

writeln(’x or y = ’, z);

writeln;

x:=true; y:=true;

writeln(’x=’, x, ’y=’, y);

z:=not x;

writeln(’not x = ’, z);

z:=x and y;

writeln(’x and y = ’, z);

z:=x or y;

writeln(’x or y = ’, z);

writeln;

end.

# data[].attributes.body
Program P18;
type Litere = (A, B, C, D, E, F, G);
var x : Litere; y : char; i :
integer;
begin
x:=A; i:=ord(x); writeln(i);
y:=’A’; i:=ord(y); writeln(i);
end.

# data[].attributes.body
;type Indice=1..10;var i, j, k, m : Indice;beginwriteln(’Introduceti indicii i, j:’);readln(i, j);k:=i+j; writeln(’k=’, k);m:=i-j; writeln(’m=’, m);

# data[].attributes.body
program n_factorial;{antet}

{blocul de declaratii si
definitii:}
var
n,i,fac:integer;

{corpul programului:}
begin
write('Introduceti  N ');
readln(n);

fac:=1;{initializare}

{ciclu for pentru calculare
factorial:}
for i:=1 to n do
fac:=fac*i;

writeln('N factorial ',fac);
{afisare total numere
negative}

readln;
end.

# data[].attributes.body
Program P3;
{ Operatii cu date de tipul integer }
var x, y, z : integer;
begin
writeln(’Introduceti numerele intregi x, y:’);
readln(x, y);
writeln(’x=’, x);
writeln(’y=’, y);
z:=x+y; writeln(’x+y=’, z);
z:=x-y; writeln(’x-y=’, z);
z:=x*y; writeln(’x*y=’, z);
z:=x mod y; writeln(’x mod y=’, z);
z:=x div y; writeln(’x div y=’, z);
end.

# data[].attributes.body
Program P16;
{ Tipul de date Studii si
Raspuns}
type Studii = (Elementare=1,
Medii, Superioare);
Raspuns = (Nu, Da);
var i : integer; {numar de
ordine}
begin
i:=ord(Elementare); writeln(i);
i:=ord(Medii); writeln(i);
i:=ord(Superioare); writeln(i);
i:=ord(Nu); writeln(i);
i:=ord(Da); writeln(i);
end.

# data[].attributes.body
Program P20;
{Ecuatii de gradul II}
var a, b, c, x1, x2, delta :real;
begin
write('Introduceti a, b, c');
read(a, b, c);
delta:=b*b-4*a*c; write (delta);
x1:=(-b-sqrt(delta))/(2*a);
x2:=(-b+sqrt(delta))/(2*a);
write ('Solutiile sunt:',x1, x2);
end.

# data[].attributes.body
program arie_patrat;
var lat, aria: integer;
begin
writeln(‘Dati latura patratului’);
readln(lat);
aria := lat * lat;
write(‘Aria patratului este ‘, aria);
end.

# data[].attributes.body
Program P108;
{Comunicarea prin variabile globale }
var a, {variabilă globală în P }
b : real; {variabilă globală în P, F }
procedure P;
var c : integer; {variabilă locală în P }
begin
c:=2;
b:=a*c;
end; { P }
function F : real;
var a : 1..5; {variabilă locală în F }
begin
a:=3;
F:=a+b;
end; { F }
begin
a:=1;
P;
writeln(b); {se afişează 2.0000000000E+00 }
writeln(F); {se afişează 5.0000000000E+00 }
readln;
end.

# data[].attributes.body
Program culori ;
{ Operatii relationale asupra
valorilor de tip ordinal }
type Culoare = (Galben,
Verde, Albastru, Violet);
begin
writeln(Verde<Violet);
{true}
writeln(Verde<=Violet);
{true}
writeln(Verde=Violet);
{false}
writeln(Verde>=Violet);
{false}
writeln(Verde>Violet);
{false}
writeln(Verde<>Violet);
{true}
end.

# data[].attributes.headline
Program de calcul a ecuatiei de gradul II

# data[].attributes.subject
Program de calcul a ecuatiei de gradul II

# data[].attributes.body
program P20oct_Anton_Gheorghe;
{Ecuatii de gradul 2}
var a, b, c, DELTA, x1, x2 :real;
begin
Writeln ('Introduceti a, b, c');
read (a,b,c);
delta:=b*b-4*a*c;
write (delta);
x1:=(-b-sqrt(delta))/(2*a);
x2:=(-b+sqrt(delta))/(2*a);
writeln ('Solutile sunt:',x1,x2);
end.

# data[].attributes.body
{ Predecesorii si succesorii valorilor ordinale } begin writeln(pred(’B’)); { ’A’ } writeln(succ(’B’)); { ’C’ } writeln(pred(0)); { -1 } writeln(succ(0)); { 1 } writeln(pred(’0’)); { ’/’ } writeln(succ(’0’)); { ’1’ } end.

# data[].attributes.body
type Zi = (L, Ma, Mi, J, V, S, D); var z1, z2 : Zi; begin z1:=Ma; writeln(ord(z1)); z2:=pred(z1); writeln(ord(z2)); z2:=succ(z1); writeln(ord(z2)); z1:=Mi; z2:=V; writeln(z1z2); writeln(z1<>z2); end. // Programul P25 #include  using namespace std; int main() { enum Zi {L, Ma, Mi, J, V, S, D} z1,z2; z1=Ma; cout<z2)<

# data[].attributes.headline
Program P66; { Tabelul functiei y=2*x }var x, y, x1, x2, deltaX : real;begin write(’x1=’); readln(x1); write(’x2=’); readln(x2); write(’deltaX=’); readln(deltaX); writeln(’x’:10, ’y’:20); writeln; x:=x1; while x<=x2 do begin y:=2*x; writeln(x:10, y:20); x:=x+deltaX; end; readln;end.

# data[].attributes.subject
Program P66; { Tabelul functiei y=2*x }var x, y, x1, x2, deltaX : real;begin write(’x1=’); readln(x1); write(’x2=’); readln(x2); write(’deltaX=’); readln(deltaX); writeln(’x’:10, ’y’:20); writeln; x:=x1; while x<=x2 do begin y:=2*x; writeln(x:10, y:20); x:=x+deltaX; end; readln;end.

# data[].attributes.body
program primul_program_pentru_Padlet;
var a, b, c, d, e, f, g, h  : integer;
begin
writeln ('introduceti 8 numere, iar programul mai intai v-a aduna, apoi va scadea, le va inmulti, apoi- imparti');
readln ( a, b, c, d, e, f, g, h);
writeln (a+b+C+D+E+F+G+H);
writeln (a-b-C-D-E-f-G-H);
writeln (a*b*C*D*E*F*G*H);
writeln (a/b/C/D/E/F/G/H);
end.

# data[].attributes.body
{ Eroare } var i : integer; x : real; begin i:=1; x:=1.0; writeln(ord(i)); writeln(ord(x)); writeln(pred(i)); writeln(pred(x)); writeln(succ(i)); writeln(succ(x)); end.

# data[].attributes.body
Program Noiembrie03_;
{Programul va transforma din km\h in m\s}
var V1, V2 : real; ani:integer;
begin
writeln ('De cati ani conduceti automobilul');
read (ani);
write ('Introduceti viteza in km\h');
read(V1);
V2:=V1*1000/3600;
write(V1, 'km/h este', V2, 'm/s');
end.

# data[].attributes.attachment_link.title
De ce este educația STEM atât de importantă

# data[].attributes.body
Program P16;
{ Tipul de date Studii si Raspuns}
type Studii = (Elementare, Medii, Superioare);
Raspuns = (Nu, Da);
var i : integer; {numar de ordine}
begin
i:=ord(Elementare); writeln(i);
i:=ord(Medii); writeln(i);
i:=ord(Superioare); writeln(i);
i:=ord(Nu); writeln(i);
i:=ord(Da); writeln(i);
end.

# data[].attributes.headline
Program pascal unde am facut verificarile

# data[].attributes.subject
Program pascal unde am facut verificarile

# data[].attributes.body
Program Ex2;
var z: real;
a, b: integer;
begin
a:=2;
b:=17;
z:=(a+b)*2;
writeln(’z=’, z);
end.

# data[].attributes.body
 Program P2;
      Uses crt;
      Var a,b,c,Suma: integer;
          media: real;
   Begin
   ClrScr;
   Write('Introduceti trei numere intregi: ');
   Readln(a,b,c);
   Suma:=a+b+c;
   Writeln('Suma numerelor ',a,', ',b,'si ',c,' este: ',Suma);
   media:=Suma/3;
   Write('Media aritmetica este: ');
   Writeln(media:5:2);
   Readkey;
   End.

# data[].attributes.body
Program P1;
{Suma numerelor intregi x,y,z}
var x,y,z,s:integer;
begin
writeln('Introduceti numerele intregi x, y, z:');
readln(x,y,z);
s := x*y*z;;
writeln('Suma numerelor introduse:');
writeln(s);
end.

# data[].attributes.body
Program Ex3c;
var a: integer;
b: real;
c: boolean;
d: char;
begin
WriteLn (SizeOf (a));
WriteLn (SizeOf (integer));
WriteLn (SizeOf (real));
WriteLn (SizeOf (char));
WriteLn (SizeOf (boolean));
end.

# data[].attributes.body
Program P3;
{ Operatii cu date de tipul integer }
var x, y, z : integer;
begin
writeln(’Introduceti numerele intregi x, y:’);
readln(x, y);
writeln(’x=’, x);
writeln(’y=’, y);
z:=x+y; writeln(’x+y=’, z);
z:=x-y; writeln(’x-y=’, z);
z:=x*y; writeln(’x*y=’, z);
z:=x mod y; writeln(’x mod y=’, z);
z:=x div y; writeln(’x div y=’, z);
end.

# data[].attributes.body
Program Ex3b;
{ Program cu eroare }
var x, y, z : integer;
m : real;
begin
writeln(’Introduceti numerele
intregi x, y:’);
readln(x, y);
writeln(’Introduceti un numar
real m:’);
readln (m);
z:=m mod y;
writeln(’m mod y=’, z);
z:=m div y;
writeln(’m div y=’, z);
end.

# data[].attributes.body
program as8;

uses crt;

var a,b,c,d:integer;

x1,x2:real;

begin

clrscr;

write('a=');readln(a);

write('b=');readln(b);

write('c=');readln(c);

if a=0 then write('Ecuatia nu este de grad 2')

else

begin

d:=b*b-4*a*c;

if d<0 then write('Ecuatia are radacini complexe')

else begin

x1:=-1*b/(2*a)+sqrt(d)/(2*a);

x2:=-1*b/(2*a)-sqrt(d)/(2*a);

writeln('x1=',x1:3:1);

writeln('x2=',x2:3:1)

end

end;

readln;

end.

# data[].attributes.body
program as10;

uses crt;

var n,a,b,c:integer;

begin

clrscr;

write('n=');readln(n);

a:=0;

b:=1;

write('Primele ',n,' numere din sirul lui fibonacci sunt ');

write(a,' ',b,' ');

n:=n-2;

while n>0 do begin

c:=a+b;

write(c,' ');

n:=n-1;

a:=b;

b:=c

end;

readln;

end.

# data[].attributes.body
program t1;

uses crt;

var a:array[1..20] of integer;

n,min,max,i:integer;

begin

clrscr;

write('Dimensiunea sirului=');readln(n);

write('Introduceti sirul ');

for i:=1 to n do read(a[i]);

min:=a[1];

for i:=2 to n do if a[i]<min then min:=a[i];

max:=a[1];

for i:=2 to n do if a[i]>max then max:=a[i];

writeln('Minimul sirului este ',min);

writeln('Maximul sirului este ',max);

readln;readln;

end.

# data[].attributes.body
program t2;

uses crt;

var a:array[1..20] of integer;

n,v,poz,i:integer;

begin

clrscr;

write('n=');readln(n);

write('Sirul');

for i:=1 to n do read(a[i]);

write('Valoarea cautata=');readln(v);

poz:=0;

for i:=1 to n do if a[i]=v then poz:=i;

if poz=0 then write('Valoarea nu este in sir')

else write('Valoarea se gaseste pe pozitia ',poz);

readln;

end.

# data[].attributes.body
program t3;

uses crt;

var a:array[1..20] of integer;

n,i,aux:integer;

begin

clrscr;

write('n=');readln(n);

write('Sirul');

for i:=1 to n do read(a[i]);

for i:=1 to n div 2 do begin

aux:=a[i];

a[i]:=a[n-i+1];

a[n-i+1]:=aux

end;

write('Sirul inversat este ');

for i:=1 to n do write(a[i],' ');

readln;

readln;

end.

# data[].attributes.body
Program arie_patrat;
var lat,aria:integer;
begin
writeln('Dati latura patratului');
Readln(lat);
aria:=lat *lat;write ('Aria patratului este ' aria);
end.

# data[].attributes.body
program viteza1;
{PROGRAMUL VA TRANSFORMA KM IN M/S}
VAR V1, V2 : REAL; ani: integer;
BEGIN
WRITeln('de cati ani conduceti automobilul');
read (ANI);
WRITe('introduceti viteza in km/H');
read(ani);
read(V1);
v2:=V1*1000/3600;
WRITE(v1,'km/s este ', v2,'m/s');

ENd.

# data[].attributes.body
program t4;

uses crt;

var a:array[1..20] of integer;

n,s,k,i:integer;

begin

clrscr;

write('n=');readln(n);

write('Sirul');

for i:=1 to n do read(a[i]);

s:=0;

k:=0;

for i:=1 to n do if a[i] mod 2=0 then begin

s:=s+a[i];

k:=k+1

end;

writeln('Media aritmetica a numerelor pare este ',s/k:4:2);

s:=0;

k:=0;

for i:=1 to n do if a[i] mod 2<>0 then begin

s:=s+a[i];

k:=k+1

end;

writeln('Media aritmetica a numerelor impare este ',s/k:4:2);

readln;readln;

end.

# data[].attributes.body
Program P108;
{Comunicarea prin variabile globale }
var a, {variabilă globală în P }
b : real; {variabilă globală în P, F }
procedure P;
var c : integer; {variabilă locală în P }
begin
c:=2;
b:=a*c;
end; { P }
function F : real;
var a : 1..5; {variabilă locală în F }
begin
a:=3;
F:=a+b;
end; { F }
begin
a:=1;
P;
writeln(b); {se afişează 2.0000000000E+00 }
writeln(F); {se afişează 5.0000000000E+00 }
readln;
end.

# data[].attributes.body
program t5;

uses crt;

var a:array[1..20] of integer;

n,i,aux:integer;

ordonat:boolean;

begin

clrscr;

write('n=');readln(n);

write('Sirul');

for i:=1 to n do read(a[i]);

ordonat:=false;

while ordonat=false do begin

ordonat:=true;

for i:=1 to n-1 do if a[i]>a[i+1] then

begin

aux:=a[i];

a[i]:=a[i+1];

a[i+1]:=aux;

ordonat:=false

end;

end;

write('Sirul ordonat este ');

for i:=1 to n do write(a[i],' ');

readln;

end.

# data[].attributes.body
program t6;

uses crt;

var a,b,c:array[1..20] of integer;

n,m,i,j,k:integer;

begin

clrscr;

write('n=');readln(n);

write('Primul sir=');

for i:=1 to n do read(a[i]);

write('m=');readln(m);

write('Al doilea sir=');

for j:=1 to m do read(b[j]);

i:=1;

j:=1;

k:=0;

while (i<=n) and (j<=m) do

begin

k:=k+1;

if a[i]<b[j] then begin

c[k]:=a[i];

i:=i+1

end

else begin

c[k]:=b[j];

j:=j+1

end

end;

if i>n then for i:=j to m do begin

k:=k+1;

c[k]:=b[i]

end

else for j:=i to n do begin

k:=k+1;

c[k]:=a[j]

end;

write('Sirul rezultat este ');

for i:=1 to k do write(c[i],' ');

readln;readln;

end.

# data[].attributes.body
Programul ce urmeaza afisaza pe ecran numerele de ordin ale valorilor ripurilor de date. Studii sin raspuns

# data[].attributes.body
Program P19;
{ Valorile variabilelor de tip subdomeniu }
type Indice = 1..10;
Zi = (L, Ma, Mi, J, V, S, D);
ZiDeLucru = L..V;
ZiDeOdihna = S..D;
var i : Indice; { valori posibile: 1, 2, ..., 10 }
z : Zi; { valori posibile: L, Ma, ..., D }
zl : ZiDeLucru; { valori posibile: L, Ma, ..., V }
zo : ZiDeOdihna; { valori posibile: S, D }
begin
i:=5; i:=11; { Eroare, i>10 }
z:=L; zl:=J; zl:=S; { Eroare, zl>V }
zo:=S; zo:=V; { Eroare, zo<S }
writeln('Sfarsit');
end.

# data[].attributes.body
var;
a,b: boolean;
begin;
Writeln ('Introdu 3 numere');
readln (a,b);
if a>b then ;
x:True;
if a<b then ;
x : False;
if a=b then;
x: True;
writeln('Rezultatul= ',x);
readln;
end.

# data[].attributes.body
var major : boolean;
varsta :integer;
begin;
write ('Introduceti varsta dumnevoastra ');
readln (varsta);
if varsta >=18 ; then major := true;
else major :=false;
writeln (major);
end;