fork 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 in = new Scanner (System.in);
  8. int n;
  9. n = in.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] = in.nextDouble();
  15. }
  16. }
  17. int i0, j0;
  18. i0 = in.nextInt();
  19. j0 = in.nextInt();
  20. for (int i=0, tr=0; tr<n-1;) {
  21. if (i!=i0-1) {
  22. for (int j=0, td=0; td<n-1; j++, td++) {
  23. if (j==j0-1) j++;
  24. m1[tr][td]=m[i][j];
  25. }
  26. i++;
  27. tr++;
  28. }
  29. else i++;
  30. }
  31. m=m1;
  32. for (int i=0; i<n-1; i++) {
  33. for (int j=0; j<n-1; j++) {
  34. System.out.print(m[i][j]+" ");
  35. }
  36. System.out.println();
  37. }
  38. }
  39. }
Success #stdin #stdout 0.16s 321280KB
stdin
4	
0.5 1 6 0
3 8 12 0.3
10 4.6 8 9
0 3.5 6.4 10
4 3
stdout
0.5    1.0    0.0    
3.0    8.0    0.3    
10.0    4.6    9.0