Răspuns :
1.1
var n,b,c,d:Integer;
begin
read(n,c);
d:=1;
while n>0 do
begin if n mod 10<>c then
begin inc(b,(n mod 10)*d);
d:=d*10;
end;
n:=n div 10;
end;
writeln(b);
end.
1.2
var a,b,t:integer;
begin
read(a,b);
while b<>0 do
begin
t := b;
b := a mod b;
a := t;
end;
if a=1 then writeln('Numerele sint prime intre ele.') else writeln('Numerele nu sint prime intre ele.');
end.
1.3
var x,x1,x2,a,b,c,d:real;
begin
read(a,b,c);
if (a<>0) and (b<>0) and (c<>0) then begin
d:=sqr (b) - 4 * a * c;
if d<0 then writeln('Ecuatia n-are solutii') else
begin
x1:= (-b- sqrt(d)) / ( 2 * a);
x2:= (-b+ sqrt(d)) / ( 2 * a);
Writeln('Solutiile sint ',x1 ,' si ',x2);
end;
end;
end.
2.1
var n,c,p,i:integer;
d:real;
begin
read(n);
while n>0 do
begin
c:=n mod 10;
n:= n div 10;
if (c mod 2 = 0) then inc(p,c);
if (c mod 2 = 1) then inc(i,c);
end;
d:=p-i;
if d<0 then d:=-d;
writeln(d);
end.
2.2
var a,b,t,p,k:integer; s,m:real;
begin
read(a,b);
p:=a;
k:=b;
while b<>0 do
begin
t := b;
b := a mod b;
a := t;
end;
m:=(p*k)/a;
writeln(m,' ',a);
s:=2*(m-a);
writeln(s);
end.
2.3
var a,b,c:real;
begin
read(a,b,c);
if (a+b<c) or (b+c<a) or (a+c<b) then writeln('Nu exista asa triunghi.') else
begin
write('Exista asa triunghi.');
if (a=b) and (a=c) then write(' Triunghiul este echilateral.') else
if (a=b) or (b=c) or (a=c) then write(' Triunghiul ese isoscel.') else
if (sqr(a)=sqr(b)+sqr(c)) or (sqr(b)=sqr(a)+sqr(c)) or (sqr(c)=sqr(a)+sqr(b)) then write(' Triunghiul este dreptunghic.') else write(' Triunghiul este arbitrar.');
end;
end.
3.1
var n,b,d:Integer;
begin
read(n);
d:=1;
while n>0 do
begin
if n mod 10<6 then
begin
inc(b,(n mod 10)*d);
d:=d*10;
end;
n:=n div 10;
end;
writeln(b);
end.
3.2
var a,b,t,p,k:integer; m:real;
begin
read(a,b);
p:=a;
k:=b;
while b<>0 do
begin
t := b;
b := a mod b;
a := t;
end;
m:=(p*k)/a;
if (m mod 2 = 0) then writeln('Multiplul este par') else writeln('Multiplul este impar);
end.
3.3
var x1,x2,y1,y2:integer; d:real;
begin
read(x1,y1);
writeln('Primul punct are coordonatele ',x1,' si ',y1);
read(x2,y2);
writeln('Al doilea punct are coordonatele ',x2,' si ',y2);
d:=sqrt(sqr(x2-x1)+sqr(y2-y1));
writeln('Distanta dintre cele 2 puncte ',d);
if (x1>=0) and (y1>=0) then writeln('Primul punct este in cadranul I') else
if (x1<0) and (y1>=0) then writeln('Primul punct este in cadranul II') else
if (x1<0) and (y1<0) then writeln('Primul punct este in cadranul III') else
if (x1>=0) and (y1<0) then writeln('Primul punct este in cadranul IV');
if (x2>=0) and (y2>=0) then writeln('Al doilea punct este in cadranul I') else
if (x2<0) and (y2>=0) then writeln('Al doilea punct este in cadranul II') else
if (x2<0) and (y2<0) then writeln('Al doilea punct este in cadranul III') else
if (x2>=0) and (y2<0) then writeln('Al doilea punct este in cadranul IV');
end.
4.1
var n,s,c:integer;
begin
read(n);
s:=0;
while n>0 do
begin
c:=n mod 10;
n:= n div 10;
if c=0 then inc(s);
end;
if s>0 then writeln('Una sau mai multe cifre sint nule') else writeln('Toate cifrele sunt nenule');
end.
4.2
function Cmmmc(n1,n2:integer):integer;
var m,mc:integer;
beginif n1>n2 then m:=n1 else m:=n2;
mc:=m-1;
repeat inc(mc);
until ((mc mod n1)=0) and ((mc mod n2)=0);
Cmmmc:=mc;
end;
var a,b,c:integer;
begin
read(a,b,c);
write('Cel mai mic multiplu comun ',Cmmmc(Cmmmc(a,b),c));
end.
4.3
var a,b:integer;
begin
read(a,b);
if (b=0) then write('Nu pot forma o fractie.') else
begin
write('Pot forma o fractie.');
if (a mod b = a) then write(' Fractia este ireductibila') else write(' Fractia este reductibila');
end;
end.
5.1
var n,c1,c,s:integer;
begin
read(n);
s:=0;
c1:=n mod 10;
while n>0 do
begin
c:=n mod 10;
n:= n div 10;
if c<>c1 then inc(s);
end;
if s>0 then writeln('Toate cifrele nu sunt egale.') else writeln('Toate cifrele sunt egale.')
end.
5.2
Var a,b,c:integer;
Function Cmmdc(a,b:integer):integer;
begin
while a<>b do
if a>b then a:=a-b else b:=b-a;
Cmmdc:=a;
end;
begin
read(a,b,c);
writeln('Cel mai mare divizor comun ',Cmmdc(Cmmdc(a,b),c));
end.
5.3
var a,b,c,s:integer;
beginread(a,b);
if (a>b) then
begin
c:=a;
a:=b;
b:=c;
end;
for a:=a to b do inc(s);
writeln(s);
end.
var n,b,c,d:Integer;
begin
read(n,c);
d:=1;
while n>0 do
begin if n mod 10<>c then
begin inc(b,(n mod 10)*d);
d:=d*10;
end;
n:=n div 10;
end;
writeln(b);
end.
1.2
var a,b,t:integer;
begin
read(a,b);
while b<>0 do
begin
t := b;
b := a mod b;
a := t;
end;
if a=1 then writeln('Numerele sint prime intre ele.') else writeln('Numerele nu sint prime intre ele.');
end.
1.3
var x,x1,x2,a,b,c,d:real;
begin
read(a,b,c);
if (a<>0) and (b<>0) and (c<>0) then begin
d:=sqr (b) - 4 * a * c;
if d<0 then writeln('Ecuatia n-are solutii') else
begin
x1:= (-b- sqrt(d)) / ( 2 * a);
x2:= (-b+ sqrt(d)) / ( 2 * a);
Writeln('Solutiile sint ',x1 ,' si ',x2);
end;
end;
end.
2.1
var n,c,p,i:integer;
d:real;
begin
read(n);
while n>0 do
begin
c:=n mod 10;
n:= n div 10;
if (c mod 2 = 0) then inc(p,c);
if (c mod 2 = 1) then inc(i,c);
end;
d:=p-i;
if d<0 then d:=-d;
writeln(d);
end.
2.2
var a,b,t,p,k:integer; s,m:real;
begin
read(a,b);
p:=a;
k:=b;
while b<>0 do
begin
t := b;
b := a mod b;
a := t;
end;
m:=(p*k)/a;
writeln(m,' ',a);
s:=2*(m-a);
writeln(s);
end.
2.3
var a,b,c:real;
begin
read(a,b,c);
if (a+b<c) or (b+c<a) or (a+c<b) then writeln('Nu exista asa triunghi.') else
begin
write('Exista asa triunghi.');
if (a=b) and (a=c) then write(' Triunghiul este echilateral.') else
if (a=b) or (b=c) or (a=c) then write(' Triunghiul ese isoscel.') else
if (sqr(a)=sqr(b)+sqr(c)) or (sqr(b)=sqr(a)+sqr(c)) or (sqr(c)=sqr(a)+sqr(b)) then write(' Triunghiul este dreptunghic.') else write(' Triunghiul este arbitrar.');
end;
end.
3.1
var n,b,d:Integer;
begin
read(n);
d:=1;
while n>0 do
begin
if n mod 10<6 then
begin
inc(b,(n mod 10)*d);
d:=d*10;
end;
n:=n div 10;
end;
writeln(b);
end.
3.2
var a,b,t,p,k:integer; m:real;
begin
read(a,b);
p:=a;
k:=b;
while b<>0 do
begin
t := b;
b := a mod b;
a := t;
end;
m:=(p*k)/a;
if (m mod 2 = 0) then writeln('Multiplul este par') else writeln('Multiplul este impar);
end.
3.3
var x1,x2,y1,y2:integer; d:real;
begin
read(x1,y1);
writeln('Primul punct are coordonatele ',x1,' si ',y1);
read(x2,y2);
writeln('Al doilea punct are coordonatele ',x2,' si ',y2);
d:=sqrt(sqr(x2-x1)+sqr(y2-y1));
writeln('Distanta dintre cele 2 puncte ',d);
if (x1>=0) and (y1>=0) then writeln('Primul punct este in cadranul I') else
if (x1<0) and (y1>=0) then writeln('Primul punct este in cadranul II') else
if (x1<0) and (y1<0) then writeln('Primul punct este in cadranul III') else
if (x1>=0) and (y1<0) then writeln('Primul punct este in cadranul IV');
if (x2>=0) and (y2>=0) then writeln('Al doilea punct este in cadranul I') else
if (x2<0) and (y2>=0) then writeln('Al doilea punct este in cadranul II') else
if (x2<0) and (y2<0) then writeln('Al doilea punct este in cadranul III') else
if (x2>=0) and (y2<0) then writeln('Al doilea punct este in cadranul IV');
end.
4.1
var n,s,c:integer;
begin
read(n);
s:=0;
while n>0 do
begin
c:=n mod 10;
n:= n div 10;
if c=0 then inc(s);
end;
if s>0 then writeln('Una sau mai multe cifre sint nule') else writeln('Toate cifrele sunt nenule');
end.
4.2
function Cmmmc(n1,n2:integer):integer;
var m,mc:integer;
beginif n1>n2 then m:=n1 else m:=n2;
mc:=m-1;
repeat inc(mc);
until ((mc mod n1)=0) and ((mc mod n2)=0);
Cmmmc:=mc;
end;
var a,b,c:integer;
begin
read(a,b,c);
write('Cel mai mic multiplu comun ',Cmmmc(Cmmmc(a,b),c));
end.
4.3
var a,b:integer;
begin
read(a,b);
if (b=0) then write('Nu pot forma o fractie.') else
begin
write('Pot forma o fractie.');
if (a mod b = a) then write(' Fractia este ireductibila') else write(' Fractia este reductibila');
end;
end.
5.1
var n,c1,c,s:integer;
begin
read(n);
s:=0;
c1:=n mod 10;
while n>0 do
begin
c:=n mod 10;
n:= n div 10;
if c<>c1 then inc(s);
end;
if s>0 then writeln('Toate cifrele nu sunt egale.') else writeln('Toate cifrele sunt egale.')
end.
5.2
Var a,b,c:integer;
Function Cmmdc(a,b:integer):integer;
begin
while a<>b do
if a>b then a:=a-b else b:=b-a;
Cmmdc:=a;
end;
begin
read(a,b,c);
writeln('Cel mai mare divizor comun ',Cmmdc(Cmmdc(a,b),c));
end.
5.3
var a,b,c,s:integer;
beginread(a,b);
if (a>b) then
begin
c:=a;
a:=b;
b:=c;
end;
for a:=a to b do inc(s);
writeln(s);
end.
Vă mulțumim că ați accesat site-ul nostru dedicat Informatică. Sperăm că informațiile furnizate v-au fost utile. Dacă aveți întrebări sau aveți nevoie de asistență suplimentară, nu ezitați să ne contactați. Vă așteptăm cu drag să reveniți și nu uitați să ne salvați la favorite!