Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Bitnami MediaWiki
Search
Search
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
0836 - AfisareVectorRec1
(section)
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Explicații== Programul citeste un sir de valori naturale de la tastatura si apoi afiseaza aceste valori in ordine inversa, utilizand o functie recursiva. In functia citire() se citeste de la tastatura cate o valoare la fiecare iteratie, verificandu-se daca aceasta este diferita de 0 si daca este un numar natural. Valoarea citita se adauga la lista lista_valori pana cand se citeste 0, caz in care se returneaza lista cu valorile citite. In functia afisare_inversa() se apeleaza functia citire() pentru a citi lista de valori si apoi se apeleaza functia recursiva afisare_inversa_recursiv() cu parametrii lista de valori si indexul ultimului element din lista. Aceasta functie recursiva se apeleaza pe ea insasi, afisandu-se valoarea corespunzatoare indexului curent si apoi apelandu-se recursiv functia cu indexul anterior, pana cand indexul devine 0 si se afiseaza ultima valoare din lista. In functia main() se apeleaza functia afisare_inversa() pentru a citi si afisa valorile in ordine inversa, tratandu-se cazurile in care valorile citite nu corespund cerintelor prin afisarea unui mesaj corespunzator.
Summary:
Please note that all contributions to Bitnami MediaWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Bitnami MediaWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Toggle limited content width