Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Example program
- #include <iostream>
- #include <string>
- #include <iostream>
- using namespace std;
- int main()
- {
- int n;
- cin>>n;
- int m;
- cin>>m;
- int matrix [n][m];
- for(int red = 0; red<n; red++)
- {
- for(int kolona = 0; kolona<m; kolona++){
- cin>>matrix[red][kolona];
- }
- }
- for(int red = 0; red<n; red++)
- {
- int sumaNaRedove = 0;
- for(int kolona = 0; kolona<m; kolona++){
- cout<<matrix[red][kolona];
- if(matrix[red][kolona]%2!=0)
- {
- sumaNaRedove = sumaNaRedove + matrix[red][kolona];
- }
- }
- cout<<" - sumata na nechetnite elementi ot red "<<red<<" e "<<sumaNaRedove<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment