Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int Sumar(int* matrix);
- int suma;
- int main(){
- int matrix[5][8] = { { 0, 0, 0, 0, 0, 0, 0, 0 },{ 1, 0, 1, 0, 0, 0, 1, 1 },{
- 1, 1, 0, 1, 0, 0, 1, 1 },{ 1, 1, 1, 1, 1, 1, 1, 1 },{ 1, 0, 0, 1, 0, 0, 1,
- 0
- } };
- for(int i = 0;i<5;i++){
- Sumar(matrix[i]);
- cout <<suma<<endl;
- }
- return 0;
- }
- int Sumar(int* matrix){
- for (int j = 0; j < 8; j++)
- {
- suma = matrix[j] + matrix[j+1];
- }
- return suma;
- }
Add Comment
Please, Sign In to add comment