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
0767 - Suma Pare2
(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 == Acest cod este scris in limbajul de programare Python si contine trei functii: citire_lin_col() - aceasta functie citeste de la tastatura numarul de linii si de coloane ale matricei, verificand daca acestea se incadreaza in intervalul [1, 100]. Daca datele sunt corecte, functia returneaza aceste doua valori. citeste_valori_matrice() - aceasta functie creeaza o matrice goala si citeste de la tastatura valorile fiecarui element din matrice, verificand daca fiecare valoare este in intervalul [0, 10000]. Daca datele sunt corecte, functia adauga valoarea citita la matrice. Functia ruleaza intr-un loop infinit si poate fi oprita doar prin folosirea functiei exit(). suma_pare2() - aceasta functie primeste ca argument o matrice si calculeaza suma tuturor elementelor pare din aceasta matrice, inlocuind valoarea initiala a variabilei "raspuns" cu aceasta suma. In programul principal, se apeleaza cele trei functii in ordinea citire_lin_col(), citeste_valori_matrice() si suma_pare2(), iar rezultatul este stocat in variabila "rezultat".
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