(PDF) Subiectul 1 Rezolvari Informatica 2009 - DOKUMEN.TIPS (2023)

!!! ATENIE !!!Aceste rezolvri NU au fost aprobate de MINISTERULEDUCAIEI sau alt comisie recunoscut de Ministerul Educaiei. nconsecin nimeni nu i asum rspunderea pentru eventualele greeli i /sau perderi survenite n urma folosirii lor! Folosete rezolvrile periscul tu !!!

Dac gseti greeli sau ai nelmuriri n legtur cu o anumit rezolvaretrimite-mi un e-mail pe adresa [emailprotected] i voi ncerca slmuresc / corectez problema.

Rezolvri Subiectul I 2----------------------------------------------------------Varianta1: 1. d. 2. a. 963 b. 61, 65, 67

c. citete n z0 p1 dac n>0 atunci repeta cn%10 n[n/10] dacc%3=0 atunci zz+p*(9-c) pp*10 pn cnd n0 do begin c:=n mod 10; n:=ndiv 10; if c mod 3 = 0 then begin z:=z+p*(9-c); p:=p*10; end; end;write(' z= ',z); end. Varianta 2: 1. a. 2. a. 2 2 1 1 7 7 5 c.citete x daca x>0 atunci repeta citeste y daca x>y atunci b.19 18 17 7 0

Rezolvri Subiectul I 3---------------------------------------------------------- scriex%10 altfel scrie y%10 xy pn cnd x0 do begin write(' y= ');read(y); if x>y then write(x mod 10,' ') else write(y mod 10,''); x:=y; end; end. Varianta 3: 1. b 2. a. 5 9 9 3 5 0 b. 1 7 9 3 10

c. citeste z,x dac x>0 atunci repeta citeste y daca z0 atuncirepeta dac n%10>s atunci sn%10 altfel s11 n [n/10]

Rezolvri Subiectul I 6---------------------------------------------------------- pn cndn0 do begin if n mod 10 > s then s:=n mod 10 else s:=11; n:=ndiv 10 end; write(' S= ',s); end. Varianta 7: 1. d 2. a. 9432 b.69645 i 55946

c. citeste n nr0 a9 repeta mn cat timp m0 si m%10a executm[m/10] dac m0 atunci nrnr*10+m%10 aa-1 pn cnd a0 atunci repeta dacn%100) and (k>0) do begin c:=n mod 10; if c mod 2=1 then p:=p*c;n:=n div 10; k:=k-1; end; write(' p= ',p); end. d. citeste n,k p1pentru ik,1,-1 executa dac n>0

Rezolvri Subiectul I 10---------------------------------------------------------- atuncicn%10 dac c%2=0 atunci pp*c n[n/10] scrie p Varianta 12: 1. d 2. a.17396 c. var x,y:longint; begin write(' x= '); read(x); y:=0; whilex0 do begin while x>9 do x:= x div 10; y:=y*10+x; write(' x= ');read(x); end; write(' y= ',y); end. d. citeste x y0 daca x0 atuncirepeta daca x>9 atunci repeta x[x/10] pn cnd x0 do begin if nmod 2 =1 then c:=c+1; n:=n div 10 end; if c>0 then k:=k+1; end;write(' k= ',k); end. d. citeste a,b k0 ia ct timp i0 executa dacn%2=1 atunci cc+1 n[n/10] dac c>0 atunci kk+1 ii+1 scrie kVarianta 14: 1. a 2. a. 27596 b. 371 35 211 0 (oricare 3 nr. cucifra maxima subliniata) b. 61, 62

(Video) Computational Thinking - Computer Science for Business Leaders 2016

c. var x, n, y, c:integer; begin

Rezolvri Subiectul I 12----------------------------------------------------------write('x= '); read(x); n:=0; while x0 do begin y:=x; c:=0; while y>0 dobegin if y mod 10 >c then c:=y mod 10; y:= y div 10; end;n:=n*10+c; write(' x= '); read(x); end; write(' n= ',n); end. d.citete x n0 dac x0 atunci repeta yx; c0 daca y>0 atunci repetadac y%10>c atunci cy%10 y[y/10] pn cnd yb atunci mm*10+b ab pncnd n0 i a%b0 atunci scrie , aa%b; i0 b. 3210

Rezolvri Subiectul I 17---------------------------------------------------------- scrie[(a*10)/10] a(a*10)%b ii+1 ct timp in i a0 executa scrie[(a*10)/10] a(a*10)%b ii+1 c. var a, n, b, i:integer; begin write('a= '); read(a); write(' b= '); read(b); write(' n= '); read(n); ifb=0 then write(' GRESIT') else begin write( a div b); if (n>0)and (a mod b 0) then begin write(','); a:=a mod b; i:=0; repeatwrite((a*10) div b); a:=(a*10) mod b; i:=i+1; until (i=n) or (a=0)end; end; end. d. a=29, b=4 i n=4 (oricare 2 nr. care mprite sa aibnumai n-2 zecimale)

Varianta 22: 1. b 2. a. 15 c. var n,d,i:integer; begin write('n= '); read(n); if nb then begin c:=b; b:=a; a:=c; end; while abatunci cb; ba; ac dac ab scrie a Varianta 33: 1. c 2. a. 135 c. varx,y,p:integer; begin write(' x= '); read(x); write(' y= ');read(y); p:=0; repeat if y mod 2 0 then p:=p+x; y:= y div 2;x:=x*2; until yy then x:=x mod y else y:=y mod x; write(' x+y=',x+y); end. Varianta 44: 1. a

Rezolvri Subiectul I 33----------------------------------------------------------2. a. 555b. 338 (orice nr de forma xy8 cu x,y din intervalul [1,9])

c. citete x y0 dac x>y atunci repet yy*10+9-x%10 pn cnd xy doy:=y*10+9-x mod 10; write(' y= ',y); end. Varianta 45: 1. a 2. a. 9b. 38

c. citete x,y z1 t0 dac xz atunci repeta dac x%z=y atunci tzzz+1 pn cnd x=z do begin if x mod z = y then t:=z;

Rezolvri Subiectul I 34----------------------------------------------------------z:=z+1;end; write(' t= ',t); end. Varianta 46: 1. c 2. a. 1 b. 75

c. var n,s,nr:longint; begin write(' n= '); read(n); s:=0;nr:=0; while n0 do begin if n mod 2 =0 then s:=s*10+n mod 10; n:=ndiv 10; end; if s0 then nr:=1; write(' nr= ',nr); end. d. citete ns0 nr0 dac n0 atunci repeta dac n%2=0 atunci ss*10+n%10 n[n/10] pncnd n=0 dac s0 atunci nr1 scrie nr Varianta 47: 1. d 2. a. 7 b.7

Rezolvri Subiectul I 35----------------------------------------------------------c.citeste n max0 n[n/10] dac maxn d. var n,i,nr,x:longint; beginwrite(' n= '); read(n); for i:=1 to n do begin write(' x= ');read(x); nr:=0; while x>0 do begin nr:=nr*100+x mod 10; x:=x div100; end; while nr>0 do begin x:=x*10+nr mod 10; nr:=nr div 10end; writeln(' x= ',x); end; end. Varianta 49: 1. b 2. a. 204 b.92837 (in loc de 2 si 3 pot fi orice cifre)

c. citeste x k0 daca x0 atunci repeta kk*10+x%10 x[x/10] panacand x=0 daca k0 atunci repeta xx*10+k%10 k[k/100] pana cand k=0scrie x d. var x,k:longint; begin write(' x= '); read(x);

Rezolvri Subiectul I 37----------------------------------------------------------k:=0;while x0 do begin k:=k*10+x mod 10; x := x div 10; end; while k0 dobegin x:=x*10+k mod 10; k:=k div 100; end; write(' x= ', x); end.Varianta 50: 1. b 2. a. 2 b. 90 196 5293 95 (oricare 4 nr. Care aucifra zecilor 9)

c. citeste n k9 i1 repeta citeste x c[x/10]%10 daca cn scrie kd. var n,i,k,c,x:integer; begin write(' n= '); read(n); k:=9; fori:=1 to n do begin write(' x= '); read(x); c:=x div 10 mod 10; ifcn daca cc ss+p n[n/10] scrie s d. var n,s,c,p,i:integer; beginwrite(' n= '); read(n); s:=0; while n>0 do b. 1353 (orice nr cutoate cifrele impare)

Rezolvri Subiectul I 41----------------------------------------------------------beginc:=n mod 10; if c mod 2=0 then begin p:=1; for i:=2 to c do p:=p*i;s:=s+p; end; n:= n div 10; end; write(' s= ',s); end. Varianta 55:1. a 2. a. k=3 c. citete n citete a k0 i2 repeta citete b daca%10=b%10 atunci kk+1 ab ii+1 pana cand i>n scrie k d. varn,a,k,i,b:integer; begin write(' n= '); read(n); write(' a= ');read(a); k:=0; for i:=2 to n do begin write(' b= '); read(b); if amod 10=b mod 10 then k:=k+1; a:=b; end; write(' k= ',k); end. b. 585 935 15 5 75

Rezolvri Subiectul I 42----------------------------------------------------------Varianta56: 1. b 2. a. 1020 b. 1817 (orice nr de forma x8y7)

c. var n,r:longint; begin write(' n= '); read(n); r:=0; repeatr:=(r*10+n mod 10)*10; n:= n div 100; until n=10 executar(r*10+n%10)*10 n[n/100] scrie r Varianta 57: 1. d 2. a. 3 c. varn,q,i:integer; begin write(' n= '); read(n); q:=1; i:=1; whilei< n div i do begin if n mod i =0 then q:=q+i; i:=i+3; end;write(' q= ',q); end. d. citete n q1 i1 b. 63 70 77 91 98 (unuldintre ele)

Rezolvri Subiectul I 43----------------------------------------------------------dacai=[n/i] scrie q Varianta 58: 1. c 2. a. 1101 c. var n,q:integer;begin write(' n= '); read(n); q:=1; while n>0 do begin if n mod5 =0 then q:=q*10 else q:=q*10+1; n:=n div 5; end; write(' q= ',q);end. d. citete n (numr natural) q1 daca n>0 atunci repeta dacn%5=0 atunci qq*10 altfel qq*10+1 n[n/5] pana cand n=0 scrie qVarianta 59: 1. b 2. a. 2 b. orice nr intre 30 si 39 b. 50

Rezolvri Subiectul I 44----------------------------------------------------------c. varn,i:longint; begin write(' n= '); read(n); repeat n:=n mod 100 div10 + n div 10; until n=0 executa n[(n%100)/10]+[n/10] scrie nVarianta 60: 1. a 2. a. 7 b. 24531 (orice nr care in fata lui 5 arenumai cifre pare)

c. var n,c:longint; begin write(' n= '); read(n); c:=10; while nmod 2=1 do begin c:=n mod 10; n:= n div 10; end; write(' c= ',c);end. d. citete n (numr natural) c10 daca n%2=1 atunci repeta cn%10n[n/10] pana cand n%21 scrie c Varianta 61: 1. d

Rezolvri Subiectul I 45----------------------------------------------------------2. a.1303 c. var a,b,n,x,y:integer; begin write(' a= '); read(a);write(' b= '); read(b); n:=0; while ab do begin x:=a mod 10; y:=bmod 10; if xb then begin b:=a; v:=aux; end; end; write(v,' ',b);end. d. citete n, d b0 v0 pentru i1,n execut citete x a0 auxx dacax%d=0 atunci repeta aa+1 x[x/d] pana cand x%d0 dac a>b atunci bavaux scrie v, ,b Varianta 64: 1. c 2. a. 2 3 4 4 5 6 5 6 7 8 10 c.var n,k,i,j:integer; begin write(' n= '); read(n); k:=0; for i:=1to n do for j:=1 to i do begin write(i+j,' '); b. 15

Rezolvri Subiectul I 48----------------------------------------------------------k:=k+1;end; write(k); end. d. citete n k0 i1 cat timp i=y atunci repetaxx-y nn+1 pana cand x9 do x:=x div 10; for j:=1 to i-1 do x:=x*10;s:=s+x; end; write(' s= ',s); end. d. s0 citete n (numr natural)pentru i1,n execut citete x daca x>9 atunci repeta x[x/10] pncnd x0 i i%2=1 execut scrie * jj-1 b1

Rezolvri Subiectul I 54---------------------------------------------------------- dac b 0atunci salt la rnd nou (sfrit de rnd) c. var n,i,b,j:integer; beginwrite(' n= '); read(n); for i:=1 to 2*n-1 do begin b:=0; if n-i=0do begin write('*'); j:=j-1; b:=1; end; if b0 then writeln; end;end. d. citete n pentru i1,2*n-1 execut b 0 j |n-i| ct timp j 0execut scrie * jj-1 b1 dac b = 0 atunci salt la rnd nou (sfrit dernd) Varianta 73: 1. c 2. a. 12 c. var a,b,p,nr,x,i:integer; beginwrite(' a= '); read(a); b. 125

Rezolvri Subiectul I 55----------------------------------------------------------write('b= '); read(b); write(' p= '); read(p); nr:=0; for i:=a to b dobegin x:=i; while (x0) and (x mod p 0) do x:=x div 10; if x0 thennr:=nr+1; end; write(' nr= ',nr); end. d. citete a, b, p nr0 pentruia,b execut x i daca x0 i x%p0 atunci repeta x[x/10] pn cnd x=0 saux%p=0 dac x 0 atunci nrnr+1 scrie nr Varianta 74: 1. a 2. a. c=15p=322

b. b=17335 (orice nr cu cifrele nesubliniate ca in exemplu) c.var a,b,c,p:longint; begin write(' a= '); read(a); write(' b= ');read(b); c:=0; p:=0; while a+b>10 do begin if (a mod 10 = b mod10) and (a mod 10 mod 2=1) then c:=c*10 + b mod 10 else p:=p*10 + amod 10; a:=a div 10;

Rezolvri Subiectul I 56----------------------------------------------------------b:=b div10 end; write(' c= ',c,' end.

p= ',p);

d. citete a,b (numere naturale) c 0 p 0 ct timp a + b > 10execut dac (a%10 = b%10) i (a%10%2=1) atunci c c + 1 altfel p p*10+ a%10 a [a/10] b [b/10] scrie c, p Varianta 75: 1. d 2. a.62255661 c. var a,k,x:longint; begin a:=0; k:=0; repeat write(' x='); read(x); while x>99 do x:=x div 10; if x>9 then begina:=a*100+x; k:=k+1; end; until k=4; write(' a= ',a); end. d. a0 k0cat timp k 99 execut x [x/10] dac x > 9 atunci aa*100 + x b.1253 3452 5602 7802

Rezolvri Subiectul I 57---------------------------------------------------------- kk+1scrie a Varianta 76: 1. c 2. a. 35 c. var a,x,p,c:integer; beginwrite(' a= '); read(a); x:=2; p:=1; while a>1 do begin c:=0;while a mod x =0 do begin c:=x; a:= a div x; end; if c0 thenp:=p*c; x:=x+1; end; write(' p= ',p); end. d. citete a (numrnatural) x2 p1 dac a>1 atunci repeta c0 dac x|a atunci repeta cxa[a/x] pana cand not (x|a) dac c0 atunci pp*c xx+1 pana cnd a1atunci repet c0 dac x|a atunci repet cx a[a/x] pn cnd not (x|a) dacc0 atunci kk+x xx+1 pn cnd a0 do begin c:=a mod 10; if c mod 20then begin b:=b+p*c; p:=p*10; end; a:=a div 10; end; write(' b=',b); end. d. citete a b0 p1 daca a>0 atunci repet ca%10 dacc%20 atunci

Rezolvri Subiectul I 61---------------------------------------------------------- scrie bbb+p*c pp*10 a[a/10] pn cnd a0 do begin if aux0 atunci repeta dacauxn%10 atunci dac aux=n%10 atunci ok0 altfel auxn%10 n[n/10] pncnd n0 scrie aux, ,ok

Rezolvri Subiectul I 62----------------------------------------------------------Varianta82: 1. d 2. a. 25 15 b. 7

c. var m,n,i,aux,ok,x:integer; begin write(' m= '); read(m);write(' n= '); read(n); for i:=1 to n do begin write(' x= ');read(x); aux:=x; ok:=0; while x>0 do begin if x mod 10=m thenok:=1; x:=x div 10; end; if ok=1 then write(' aux= ',aux); end;end. d. citete m citete n pentru i1,n execut citete x auxx ok0 dacax>0 atunci repeta dac x%10=m atunci ok1 x[x/10] pana cand x=10do begin if x mod 10 > x div 10 mod 10 then ok1:=0; x:=x div 10;end; if ok1=1 then write(aux) else write('NU'); end. d. citete xauxx ok11 daca x10 atunci repeta dac x%10>[x/10]%10 atunci ok10x[x/10] pana cand x0 do begin c:=n mod 10; if (c>5) and (c mod 2= 0) then ok1:=1

Rezolvri Subiectul I 64----------------------------------------------------------elseok1:=0; if ok1=1 then begin write(c,' '); ok1:=1; end; n:=n div 10;end; if ok1=0 then write('NU'); end. d. citete n ok10 daca n>0atunci repeta cn%10 dac c>5 i c%2=0 atunci ok11 altfel ok10 dacok1=1 atunci scrie c, ok11 n[n/10] pana cand n0 dac ok1=0 atunciscrie nu Varianta 85: 1. a 2. a. 5 9 c. var n,ok1,ok,c:integer;begin write(' n= '); read(n); ok:=0; while n>0 do begin c:=n mod10; if c mod 2 = 1 then ok1:=1 else ok1:=0; b. 879

Rezolvri Subiectul I 65----------------------------------------------------------if ok1=1then begin write(c,' '); ok:=1; end; n:=n div 10; end; if ok=0 thenwrite('NU'); end. d. citete n ok0 daca n>0 atunci repeta cn%10dac c%2=1 atunci ok11 altfel ok10 dac ok1=1 atunci scrie c ok1n[n/10] pana cand n0 dac ok=0 atunci scrie nu Varianta 86: 1. c 2.a. 1 2 3 4 0 1 2 c. var n,k,i:integer; begin write(' n= ');read(n); write(' k= '); read(k); for i:=1 to n do if i div k=0 thenwrite(i,' ') else write(i mod k,' '); end. b. 25 (orice nr mai mareca 20)

Rezolvri Subiectul I 66----------------------------------------------------------d. citeten, k i1 daca in Varianta 87: 1. d 2. a. 2 b. 98 91 84

c. var a,b,c,x:integer; begin write(' a= '); read(a); write(' b='); read(b); write(' c= '); read(c); while (ab) or (ac) do beginx:=a; if x>b then x:=b; if x>c then x:=c; if xa then a:=a-x;if xb then b:=b-x; if xc then c:=c-x; end; write(' a= ',a); end. d.citete a,b,c daca ab sau ac atunci repeta xa dac x>b atunci xbdac x>c atunci

Rezolvri Subiectul I 67---------------------------------------------------------- xc dacxa atunci aa-x dac xb atunci bb-x dac xc atunci cc-x pana cand a=bsi a=c scrie a Varianta 88: 1. b 2. a. 246531 c. vara,p,b,c:longint; begin write(' a= '); read(a); p:=1; b:=0; while a0do begin c:=a mod 10; if a mod 2=0 then b:=b+c*p else b:=b*10+c;a:=a div 10; p:=p*10; end; write(' b= ',b); end. d. citete a p1 b0daca a0 atunci repeta ca%10 dac a%2=0 atunci bb+c*p altfel bb*10+cb. 11262

Rezolvri Subiectul I 68---------------------------------------------------------- a[a/10]pp*10 pana cand a=0 scrie b Varianta 89: 1. a 2. a. 1012141 c. varn,t,r:longint; begin write(' n= '); read(n); t:=n; r:=0; whilet>0 do begin if t mod 10 mod 2 =1 then r:=r*10+1 else r:=r*10+tmod 10; t:=t div 10 end; n:=0; while r>0 do begin n:=n*10+r mod10; r:= r div 10; end; write(' n= ',n); end. d. citete n tn; r0daca t>0 atunci repeta dac (t%10)%2=1 atunci rr*10+1 altfelrr*10+t%10 t[t/10] pana cand t0 atunci repeta nn*10+r%10 r[r/10] b.12468

Rezolvri Subiectul I 69---------------------------------------------------------- panacand r=1) and (x

Top Articles
Latest Posts
Article information

Author: Horacio Brakus JD

Last Updated: 11/26/2022

Views: 5898

Rating: 4 / 5 (71 voted)

Reviews: 86% of readers found this page helpful

Author information

Name: Horacio Brakus JD

Birthday: 1999-08-21

Address: Apt. 524 43384 Minnie Prairie, South Edda, MA 62804

Phone: +5931039998219

Job: Sales Strategist

Hobby: Sculling, Kitesurfing, Orienteering, Painting, Computer programming, Creative writing, Scuba diving

Introduction: My name is Horacio Brakus JD, I am a lively, splendid, jolly, vivacious, vast, cheerful, agreeable person who loves writing and wants to share my knowledge and understanding with you.