public static void matrixsum(int x[][]) {
		int sumr = 0, sumc[], sumd1 = 0, sumd2 = 0;
		sumc = new int[x[0].length];
		for (int i = 0; i < x.length; i++) {
			sumr = 0;
			System.out.print("\n     ");
			for (int j = 0; j < x[i].length; j++) {
				System.out.print(x[i][j] + " ");
				sumc[j] = sumc[j] + x[i][j];
				sumr = sumr + x[i][j];
				if (i == j) {
					sumd1 = sumd1 + x[i][j];
				}
				if (j == (x[0].length - (i + 1))) {
					sumd2 = sumd2 + x[i][j];
				}
			}
			System.out.print(sumr);
		}
		System.out.print("\n" + sumd2 + " ");
		for (int i = 0; i < x[0].length; i++) {
			System.out.print(sumc[i] + " ");
		}
		System.out.print(sumd1);
		// System.out.println(sumd1 + "\n" + sumd2 + "\n");
	}