Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class matricat {
- public static void main(String[] args) {
- int[][] M = {
- {4, 33, 47, 2, 61, 5},
- {16, 24, 12, 1, 3, 8}
- };
- int shumaM = 0, elM = 0;
- long prodhimiM = 1;
- // Shuma & prodhimi i matrices
- for (int i = 0; i < M.length; i++) {
- for (int j = 0; j < M[i].length; j++) {
- shumaM += M[i][j];
- prodhimiM *= M[i][j];
- elM++;
- }
- }
- System.out.println("Shuma e matrices eshte: " + shumaM);
- System.out.println("Prodhimi i matrices eshte: " + prodhimiM);
- System.out.println("Elementet e matrices jane: " + elM);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement