По разделам

 

Решение задачи Matrix 63


Дана матрица размера M × N. Удалить строку, содержащую минимальный элемент матрицы.

Код (C/C++)

#include <bits/stdc++.h>

using namespace std;

int main()
{
    int m, n, k = INT_MAX, pos = 0;
    cin >> m >> n;
    vector<int> t(n);
    vector<vector<int> > a;
    for(int i = 0; i < m; ++i){
        for(int j = 0; j < n; ++j){
            cin >> t[j];
            if(k > t[j]){
                k = t[j];
                pos = i;
            }
        }
        a.push_back(t);
    }
    a.erase(a.begin() + pos - 1);
    for(auto i: a){
        for(auto j: i)
            cout << j << " ";
        cout << endl;
    }
    return 0;
}

Код (Pascal)

program Matrix63;
type
  matrix = array [1..10,1..10] of integer;
 
var
  a:matrix;
  MinI,MinJ, M, N, i, j:Integer;
 
procedure DelMatrixRow(var mat:matrix; X:Integer);
var
 i:integer;
begin
 M:=M-1;
 for i:=X to M do
  for j:=1 to N do
   mat[i,j]:=mat[i+1,j];
end;
 
begin
 Write('N: ');
 Readln(N);
 Write('M: ');
 Readln(M);
 
 for  i:=1 to M do
  begin
   writeln(i,': ');
   for j:=1 to N do
    begin
     Write(j,' : ');
     Read(a[i,j]);
    end;
  end;
 MinI:=1;
 MinJ:=1;
  for  j:=1 to N do
   for i:=1 to M do
     if a[i,j]<a[MinI,MinJ] then
      begin
       MinI:=i;
       MinJ:=j;
      end;
 
 
 DelMatrixRow(a,MinI);
 
 for  i:=1 to M do
  begin
   for j:=1 to N do
    begin
     Write(' : ',a[i,j]);
    end;
   writeln(' : ');
  end;
end.
									




Matrix. Абрамян
Matrix 1 Просмотров: 12039
Matrix 2 Просмотров: 4481
Matrix 3 Просмотров: 4611
Matrix 4 Просмотров: 3484
Matrix 5 Просмотров: 5122
Matrix 6 Просмотров: 3444
Matrix 7 Просмотров: 4226
Matrix 8 Просмотров: 3249
Matrix 9 Просмотров: 4087
Matrix 10 Просмотров: 2970
Matrix 11 Просмотров: 4424
Matrix 12 Просмотров: 3120
Matrix 13 Просмотров: 3085
Matrix 14 Просмотров: 2021
Matrix 15 Просмотров: 2728
Matrix 16 Просмотров: 2621
Matrix 17 Просмотров: 4447
Matrix 18 Просмотров: 2248
Matrix 19 Просмотров: 2921
Matrix 20 Просмотров: 3346
Matrix 21 Просмотров: 3344
Matrix 22 Просмотров: 2045
Matrix 23 Просмотров: 4552
Matrix 24 Просмотров: 2268
Matrix 25 Просмотров: 2514
Matrix 26 Просмотров: 2142
Matrix 27 Просмотров: 2089
Matrix 28 Просмотров: 1980
Matrix 29 Просмотров: 1892
Matrix 30 Просмотров: 1841
Matrix 31 Просмотров: 1558
Matrix 32 Просмотров: 1437
Matrix 33 Просмотров: 1531
Matrix 34 Просмотров: 1897
Matrix 35 Просмотров: 1616
Matrix 36 Просмотров: 1671
Matrix 37 Просмотров: 1426
Matrix 38 Просмотров: 1535
Matrix 39 Просмотров: 1428
Matrix 40 Просмотров: 1474
Matrix 41 Просмотров: 1187
Matrix 42 Просмотров: 1535
Matrix 43 Просмотров: 1209
Matrix 44 Просмотров: 1210
Matrix 45 Просмотров: 1267
Matrix 46 Просмотров: 1308
Matrix 47 Просмотров: 1487
Matrix 48 Просмотров: 1293
Matrix 49 Просмотров: 1278
Matrix 50 Просмотров: 1610
Matrix 51 Просмотров: 1446
Matrix 52 Просмотров: 1434
Matrix 53 Просмотров: 1310
Matrix 54 Просмотров: 1060
Matrix 55 Просмотров: 1142
Matrix 56 Просмотров: 941
Matrix 57 Просмотров: 1116
Matrix 58 Просмотров: 1391
Matrix 59 Просмотров: 1159
Matrix 60 Просмотров: 1057
Matrix 61 Просмотров: 1101
Matrix 62 Просмотров: 1084
Matrix 63 Просмотров: 1245
Matrix 64 Просмотров: 1235
Matrix 65 Просмотров: 1113
Matrix 66 Просмотров: 971
Matrix 67 Просмотров: 1001
Matrix 68 Просмотров: 1091
Matrix 69 Просмотров: 968
Matrix 70 Просмотров: 1086
Matrix 71 Просмотров: 927
Matrix 72 Просмотров: 953
Matrix 73 Просмотров: 1018
Matrix 74 Просмотров: 1000
Matrix 75 Просмотров: 882
Matrix 76 Просмотров: 1003
Matrix 77 Просмотров: 1029
Matrix 78 Просмотров: 960
Matrix 79 Просмотров: 1012
Matrix 80 Просмотров: 2614
Matrix 81 Просмотров: 1373
Matrix 82 Просмотров: 1102
Matrix 83 Просмотров: 1469
Matrix 84 Просмотров: 966
Matrix 85 Просмотров: 1039
Matrix 86 Просмотров: 959
Matrix 87 Просмотров: 1060
Matrix 88 Просмотров: 884
Matrix 89 Просмотров: 887
Matrix 90 Просмотров: 1032
Matrix 91 Просмотров: 910
Matrix 92 Просмотров: 892
Matrix 93 Просмотров: 887
Matrix 94 Просмотров: 1060
Matrix 95 Просмотров: 884
Matrix 96 Просмотров: 961
Matrix 97 Просмотров: 990
Matrix 98 Просмотров: 1159
Matrix 99 Просмотров: 1095
Matrix 100 Просмотров: 1217

Комментарии

Чтобы написать комментарии вам нужно войти в систему или зарегистрироваться



Заявка на расчет