Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main(){
- int i,j,a[50][50],m,n, s = 0;
- cout<<"Nr de linii: "; cin>>n;
- cout<<"Nr de coloane: "; cin>>m;
- for(i = 1; i <= n; i++){
- for(j = 1; j <= m; j++){
- cout<<"a["<<i<<"]["<<j<<"] = ";
- cin>>a[i][j];
- }
- }
- for(i = 1; i <= n; i++){
- for(j = 1; j <= m; j++){
- cout<<a[i][j];
- }
- cout<<endl;
- }
- cout<<endl;
- for(i = 1; i <= n; i++){
- for(j = 1; j <= m; j++){
- if(a[i][j] % 2 == 0){
- s = s + a[i][j];
- }
- }
- }
- cout<<"Suma numerelor pare este: "<<s;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment