fork(2) download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. class Ideone {
  6. public static void main (String[] args) {
  7. Scanner x = new Scanner (System.in);
  8. int n;
  9. n = x.nextInt();
  10. double [][]m = new double[n][n];
  11. double [][]m1 = new double[n-1][n-1];
  12. for (int i=0; i<n; i++) {
  13. for (int j=0; j<n; j++) {
  14. m[i][j] = x.nextDouble();
  15. }
  16. }
  17. int deli, delj;
  18. deli = x.nextInt();
  19. delj = x.nextInt();
  20. for (int i=0, ln=0; ln<n-1;) {
  21. if (i!=deli-1) {
  22. for (int j=0, cn=0; cn<n-1; j++, cn++) {
  23. if (j==delj-1) j++;
  24. m1[ln][cn]=m[i][j];
  25. }
  26. i++;
  27. ln++;
  28. } else i++; }
  29. m=m1;
  30. for (int i=0; i<n-1; i++) {
  31. for (int j=0; j<n-1; j++) {
  32. System.out.print(m[i][j]+" ");
  33. }
  34. System.out.println();
  35. }
  36. }
  37. }
Success #stdin #stdout 0.18s 321344KB
stdin
3 1 2 3 4 5 6 7 8 9 1 2
stdout
4.0    6.0    
7.0    9.0