По разделам

 

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


Дана матрица размера M ×N. Для каждого столбца матрицы найти произведение его элементов.

Код (C/C++)

#include <bits/stdc++.h>

using namespace std;

int main()
{
    system("chcp 1251");
    int m, n, k, s;
    cin >> m >> n;
    int a[m][n];
    for(int i = 0; i < m; ++i){
        for(int j = 0; j < n; ++j)
            cin >> a[i][j];
    }
    for(int i = 0; i < n; ++i){
        s = 1;
        for(int j = 0; j < m; ++j)
            s *= a[j][i];
        cout << s << endl;
    }
    return 0;
}

Код (Python)

import random
import numpy as np

M = random.randrange(2,7)
N = random.randrange(2,7)
K = random.randrange(0,N)
print("M = ",M,"; N = ",N)
a = np.zeros((M, N))

for i in range(M):
    for j in range(N):
        a[i][j] = random.randrange(1,5)
print(a)

b = a.prod(0)
print(b)
									

Код (Pascal)

program Matrix20;
var
  a:array [1..10,1..10] of integer;
  Mult,M, N, i, j:Integer;
 
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;
 
  For j:=1 to N do
   begin
    Mult:=1;
    for i:=1 to M do Mult:=Mult*a[i,j];
    Writeln(j,' Proizvedenie:',Mult);
   end;
end.
									




Matrix. Абрамян
Matrix 1 Просмотров: 11744
Matrix 2 Просмотров: 4306
Matrix 3 Просмотров: 4440
Matrix 4 Просмотров: 3317
Matrix 5 Просмотров: 4963
Matrix 6 Просмотров: 3294
Matrix 7 Просмотров: 4054
Matrix 8 Просмотров: 3087
Matrix 9 Просмотров: 3967
Matrix 10 Просмотров: 2820
Matrix 11 Просмотров: 4287
Matrix 12 Просмотров: 2992
Matrix 13 Просмотров: 2935
Matrix 14 Просмотров: 1882
Matrix 15 Просмотров: 2568
Matrix 16 Просмотров: 2456
Matrix 17 Просмотров: 4291
Matrix 18 Просмотров: 2108
Matrix 19 Просмотров: 2768
Matrix 20 Просмотров: 3184
Matrix 21 Просмотров: 3206
Matrix 22 Просмотров: 1942
Matrix 23 Просмотров: 4416
Matrix 24 Просмотров: 2169
Matrix 25 Просмотров: 2343
Matrix 26 Просмотров: 2017
Matrix 27 Просмотров: 1978
Matrix 28 Просмотров: 1879
Matrix 29 Просмотров: 1789
Matrix 30 Просмотров: 1736
Matrix 31 Просмотров: 1469
Matrix 32 Просмотров: 1336
Matrix 33 Просмотров: 1432
Matrix 34 Просмотров: 1767
Matrix 35 Просмотров: 1490
Matrix 36 Просмотров: 1571
Matrix 37 Просмотров: 1305
Matrix 38 Просмотров: 1401
Matrix 39 Просмотров: 1328
Matrix 40 Просмотров: 1348
Matrix 41 Просмотров: 1096
Matrix 42 Просмотров: 1442
Matrix 43 Просмотров: 1113
Matrix 44 Просмотров: 1116
Matrix 45 Просмотров: 1153
Matrix 46 Просмотров: 1213
Matrix 47 Просмотров: 1378
Matrix 48 Просмотров: 1171
Matrix 49 Просмотров: 1191
Matrix 50 Просмотров: 1510
Matrix 51 Просмотров: 1350
Matrix 52 Просмотров: 1337
Matrix 53 Просмотров: 1195
Matrix 54 Просмотров: 983
Matrix 55 Просмотров: 1046
Matrix 56 Просмотров: 842
Matrix 57 Просмотров: 1028
Matrix 58 Просмотров: 1275
Matrix 59 Просмотров: 1048
Matrix 60 Просмотров: 970
Matrix 61 Просмотров: 1004
Matrix 62 Просмотров: 987
Matrix 63 Просмотров: 1136
Matrix 64 Просмотров: 1137
Matrix 65 Просмотров: 1011
Matrix 66 Просмотров: 853
Matrix 67 Просмотров: 885
Matrix 68 Просмотров: 991
Matrix 69 Просмотров: 869
Matrix 70 Просмотров: 986
Matrix 71 Просмотров: 822
Matrix 72 Просмотров: 861
Matrix 73 Просмотров: 937
Matrix 74 Просмотров: 889
Matrix 75 Просмотров: 785
Matrix 76 Просмотров: 909
Matrix 77 Просмотров: 928
Matrix 78 Просмотров: 866
Matrix 79 Просмотров: 917
Matrix 80 Просмотров: 2494
Matrix 81 Просмотров: 1260
Matrix 82 Просмотров: 968
Matrix 83 Просмотров: 1359
Matrix 84 Просмотров: 866
Matrix 85 Просмотров: 941
Matrix 86 Просмотров: 872
Matrix 87 Просмотров: 960
Matrix 88 Просмотров: 775
Matrix 89 Просмотров: 785
Matrix 90 Просмотров: 942
Matrix 91 Просмотров: 811
Matrix 92 Просмотров: 770
Matrix 93 Просмотров: 795
Matrix 94 Просмотров: 941
Matrix 95 Просмотров: 776
Matrix 96 Просмотров: 877
Matrix 97 Просмотров: 893
Matrix 98 Просмотров: 1035
Matrix 99 Просмотров: 1008
Matrix 100 Просмотров: 1124

Комментарии

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



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