fork(2) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n;
  6. cin >> n;
  7. double **m;
  8. m=new double *[n];
  9. for (int i=0; i<n; i++) m[i]=new double [n];
  10. double **m1;
  11. m1=new double *[n-1];
  12. for (int i=0; i<n-1; i++) m1[i]=new double [n-1];
  13. for (int i=0; i<n; i++) {
  14. for (int j=0; j<n; j++) {
  15. cin >> m[i][j];
  16. }
  17. }
  18. int i0, j0;
  19. cin >> i0 >> j0;
  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. delete []m;
  32. m=m1;
  33. for (int i=0; i<n-1; i++) {
  34. for (int j=0; j<n-1; j++) {
  35. printf ("%5.3lf\t", m[i][j]);
  36. }
  37. cout << endl;
  38. }
  39. return 0;
  40. }
Success #stdin #stdout 0s 3432KB
stdin
2
-40 87
9 -3
1 1
stdout
-3.000