Guest User

Untitled

a guest
Feb 22nd, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #include<iostream>
  2.  
  3. using namespace std;
  4. int Sumar(int* matrix);
  5. int suma;
  6. int main(){
  7.  
  8. int matrix[5][8] = { { 0, 0, 0, 0, 0, 0, 0, 0 },{ 1, 0, 1, 0, 0, 0, 1, 1 },{
  9. 1, 1, 0, 1, 0, 0, 1, 1 },{ 1, 1, 1, 1, 1, 1, 1, 1 },{ 1, 0, 0, 1, 0, 0, 1,
  10. 0
  11. } };
  12.  
  13. for(int i = 0;i<5;i++){
  14.  
  15. Sumar(matrix[i]);
  16. cout <<suma<<endl;
  17.  
  18. }
  19. return 0;
  20.  
  21. }
  22.  
  23. int Sumar(int* matrix){
  24.  
  25.  
  26. for (int j = 0; j < 8; j++)
  27. {
  28. suma = matrix[j] + matrix[j+1];
  29. }
  30.  
  31.  
  32. return suma;
  33.  
  34. }
Add Comment
Please, Sign In to add comment