-
Notifications
You must be signed in to change notification settings - Fork 29
/
main.cpp
48 lines (43 loc) · 1.84 KB
/
main.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/**
* 完善 Matrix 类,使得下面的代码可以正常运行:
* class Matrix {
* public:
* TODO: Someting
* private:
* int rows;
* int cols;
* int **matrix;
* };
*
* 评分标准:
* 1. 代码能够正常的运行就有 100 分,若代码不能正常运行,则按以下标准进行评分:
* Matrix::Matrix(int rows, int cols): 20 points
* Matrix::~Matrix(): 20 points
* std::istream& operator>>(std::istream& in, Matrix& matrix) 20 points
* std::ostream& operator<<(std::ostream& os, const Matrix& matrix) 20 points
* Matrix Matrix::operator*(Matrix &other) 20 points
* 2. 在正常运行的基础上,若还有其他的功能,则按以下标准进行评分:
* Matrix::Matrix(int rows, int cols, int** matrix) 10 points
* template <size_t rows, size_t cols> Matrix::Matrix(int (&matrix)[rows][cols]) 10 points
* Matrix::Matrix(const Matrix& other) 10 points
* Matrix::Matrix(Matrix&& other) 10 points
* Matrix& Matrix::operator=(const Matrix& other) 10 points
* Matrix& Matrix::operator=(Matrix &&other) 10 points
* Matrix Matrix::operator+(const Matrix& other) 10 points
* Matrix Matrix::operator-(const Matrix& other) 10 points
* Matrix Matrix::operator/(const Matrix& other) 10 points
* bool Matrix::operator==(const Matrix& other) 10 points
*/
#include<iostream>
#include "matrix.h"
int main() {
int rows, cols;
std::cin >> rows >> cols;
Matrix A(rows, cols);
std::cin >> A;
std::cin >> rows >> cols;
Matrix B(rows, cols);
std::cin >> B;
std::cout << A * B;
return 0;
}