Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

4.

Citeste n
Max9
Cat_timp n >0 executa
an mod 10
Daca a> max and a mod 2=0
atunci maxa
sf_daca
n n div 10
sf_cat_timp
Daca max >9
Atunci scrie max
Altfel scrie ,, NU EXISTA’’
Sf_daca

5. Citeste n
P max * min
max9
min10
cat_timp n>0 executa
a n mod 10
Daca a>max and a mod 2=0
atunci scrie max
sf_daca
Daca a<min and a mod 2=1
Atunci scrie min
Sf_daca
n n div 10
sf_cat_timp
Daca max>9 and min<10
Atunci scrie P
Sf_daca

6.Citeste n
K0
Cat_timp n>0 executa
an mod 10
daca a mod 2=1 and a>K
atunci scrie Ka
sf_daca
nn div 10
sf_cat_timp
Daca k=0
Atunci scrie ,,NU EXISTA’’
Altfel scrie K
Sf_daca

7. Citeste n
nr0
maxn mod 10
cat_timp n>0 executa
a n mod 10
Daca a>=max
Atunci maxa
Sf_daca
Daca a>= max
Atunci nrnr+1
Sf_daca
nn div 10
sf_cat_timp
Scrie nr, max

8.Citeste n
an mod 10
nr0
cat_timp n>0 executa
bn mod 10
Daca b=a
Atunci nrnr+1
Sf_daca
Nn div 10
Sf_cat_timp
Scrie nr

You might also like