По разделам

 

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


Дана матрица размера M ×N и целое число K (1≤K ≤N). Удалить столбец матрицы с номером K.

Код (C/C++)

#include <iostream>
#include <windows.h>
#include <cmath>
#include <iomanip>
#include <fstream>
#include "IOMatrix.h"

using namespace std;

int main ()
{
  SetConsoleCP(1251);
  SetConsoleOutputCP(1251);

  double matr[RMAX][CMAX];
  int nr, nc;
  input (matr,"Matrix62.txt",nr,nc);
  output (matr,nr,nc);
  cout << endl;
  int K;
  cout << "Введите число K:"<< endl;
  cin >> K;                          
  for (int col = K; col < nc; ++col) {  	
	for (int row = 0; row < nr; ++row) {
		matr[row][col-1] = matr[row][col];
	  		 
	}
	cout << endl;
  }
  cout << "Преобразованная матрица" << endl;
  output (matr,nr,--nc);

  system ("pause");
  return 0;
}

Код (Pascal)

program Matrix62;
type
  matrix = array [1..10,1..10] of integer;
 
var
  a:matrix;
  K, M, N, i, j:Integer;
 
procedure DelMatrixColumn(var mat:matrix; X:Integer);
var
 i:integer;
begin
 N:=N-1;
 for j:=X to N do
  for i:=1 to M do
   mat[i,j]:=mat[i,j+1];
end;
 
 
begin
 Write('N: ');
 Readln(N);
 Write('M: ');
 Readln(M);
 
 Write('K: ');
 Readln(K);
 
 for  i:=1 to M do
  begin
   writeln(i,': ');
   for j:=1 to N do
    begin
     Write(j,' : ');
     Read(a[i,j]);
    end;
  end;
 
 DelMatrixColumn(a,K);
 
 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 Просмотров: 11666
Matrix 2 Просмотров: 4271
Matrix 3 Просмотров: 4393
Matrix 4 Просмотров: 3275
Matrix 5 Просмотров: 4937
Matrix 6 Просмотров: 3241
Matrix 7 Просмотров: 4024
Matrix 8 Просмотров: 3045
Matrix 9 Просмотров: 3934
Matrix 10 Просмотров: 2778
Matrix 11 Просмотров: 4260
Matrix 12 Просмотров: 2955
Matrix 13 Просмотров: 2902
Matrix 14 Просмотров: 1851
Matrix 15 Просмотров: 2530
Matrix 16 Просмотров: 2433
Matrix 17 Просмотров: 4243
Matrix 18 Просмотров: 2081
Matrix 19 Просмотров: 2738
Matrix 20 Просмотров: 3145
Matrix 21 Просмотров: 3170
Matrix 22 Просмотров: 1910
Matrix 23 Просмотров: 4384
Matrix 24 Просмотров: 2143
Matrix 25 Просмотров: 2307
Matrix 26 Просмотров: 1982
Matrix 27 Просмотров: 1942
Matrix 28 Просмотров: 1851
Matrix 29 Просмотров: 1756
Matrix 30 Просмотров: 1702
Matrix 31 Просмотров: 1437
Matrix 32 Просмотров: 1312
Matrix 33 Просмотров: 1407
Matrix 34 Просмотров: 1742
Matrix 35 Просмотров: 1460
Matrix 36 Просмотров: 1547
Matrix 37 Просмотров: 1281
Matrix 38 Просмотров: 1367
Matrix 39 Просмотров: 1298
Matrix 40 Просмотров: 1315
Matrix 41 Просмотров: 1073
Matrix 42 Просмотров: 1399
Matrix 43 Просмотров: 1086
Matrix 44 Просмотров: 1086
Matrix 45 Просмотров: 1120
Matrix 46 Просмотров: 1181
Matrix 47 Просмотров: 1350
Matrix 48 Просмотров: 1132
Matrix 49 Просмотров: 1161
Matrix 50 Просмотров: 1483
Matrix 51 Просмотров: 1323
Matrix 52 Просмотров: 1309
Matrix 53 Просмотров: 1161
Matrix 54 Просмотров: 961
Matrix 55 Просмотров: 1024
Matrix 56 Просмотров: 814
Matrix 57 Просмотров: 987
Matrix 58 Просмотров: 1251
Matrix 59 Просмотров: 1007
Matrix 60 Просмотров: 947
Matrix 61 Просмотров: 975
Matrix 62 Просмотров: 960
Matrix 63 Просмотров: 1109
Matrix 64 Просмотров: 1101
Matrix 65 Просмотров: 988
Matrix 66 Просмотров: 833
Matrix 67 Просмотров: 851
Matrix 68 Просмотров: 961
Matrix 69 Просмотров: 836
Matrix 70 Просмотров: 954
Matrix 71 Просмотров: 793
Matrix 72 Просмотров: 832
Matrix 73 Просмотров: 906
Matrix 74 Просмотров: 867
Matrix 75 Просмотров: 757
Matrix 76 Просмотров: 879
Matrix 77 Просмотров: 905
Matrix 78 Просмотров: 840
Matrix 79 Просмотров: 889
Matrix 80 Просмотров: 2457
Matrix 81 Просмотров: 1220
Matrix 82 Просмотров: 933
Matrix 83 Просмотров: 1330
Matrix 84 Просмотров: 839
Matrix 85 Просмотров: 906
Matrix 86 Просмотров: 843
Matrix 87 Просмотров: 935
Matrix 88 Просмотров: 753
Matrix 89 Просмотров: 758
Matrix 90 Просмотров: 909
Matrix 91 Просмотров: 778
Matrix 92 Просмотров: 735
Matrix 93 Просмотров: 767
Matrix 94 Просмотров: 909
Matrix 95 Просмотров: 752
Matrix 96 Просмотров: 853
Matrix 97 Просмотров: 870
Matrix 98 Просмотров: 1011
Matrix 99 Просмотров: 984
Matrix 100 Просмотров: 1096

Комментарии

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



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