forked from UNN-ITMM-Software/mp2-lab2-matrix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsample_matrix.cpp
31 lines (28 loc) · 916 Bytes
/
sample_matrix.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// ННГУ, ВМК, Курс "Методы программирования-2", С++, ООП
//
// sample_matrix.cpp - Copyright (c) Гергель В.П. 07.05.2001
// Переработано для Microsoft Visual Studio 2008 Сысоевым А.В. (20.04.2015)
//
// Тестирование верхнетреугольной матрицы
#include <iostream>
#include "utmatrix.h"
//---------------------------------------------------------------------------
void main()
{
TMatrix<int> a(5), b(5), c(5);
int i, j;
setlocale(LC_ALL, "Russian");
cout << "Тестирование программ поддержки представления треугольных матриц"
<< endl;
for (i = 0; i < 5; i++)
for (j = i; j < 5; j++ )
{
a[i][j] = i * 10 + j;
b[i][j] = (i * 10 + j) * 100;
}
c = a + b;
cout << "Matrix a = " << endl << a << endl;
cout << "Matrix b = " << endl << b << endl;
cout << "Matrix c = a + b" << endl << c << endl;
}
//---------------------------------------------------------------------------