Advertisement
fosterbl

MatrixSumming2.java

Jan 22nd, 2020
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.63 KB | None | 0 0
  1. //(c) A+ Computer Science
  2. //www.apluscompsci.com
  3. //Name -
  4.  
  5. import java.util.*;
  6. import java.io.*;
  7.  
  8. public class MatrixSumming2
  9. {
  10.     public static int sum( int[][] mat, int r, int c )
  11.     {
  12.         return 0;
  13.     }
  14.  
  15.     public static void main(String[] args){
  16.         int[][] m = {{1, 2, 3, 4, 5},
  17.                         {6, 7, 8, 9, 0},
  18.                         {6, 7, 1, 2, 5},
  19.                         {6, 7, 8, 9, 0},
  20.                         {5, 4, 3, 2, 1}};
  21.         System.out.println( sum(m, 2, 2) );
  22.         System.out.println( sum(m, 0, 0) );
  23.         System.out.println( sum(m, 4, 3) );
  24.         System.out.println( sum(m, 4, 4) );
  25.         System.out.println( sum(m, 2, 4) );
  26.         System.out.println( sum(m, 1, 3) );
  27.  
  28.      }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement