This repository has been archived on 2024-01-06. You can view files and clone it, but cannot push or open issues or pull requests.
justhomework/SoftwareDesign/Code/1-1c/main.cpp
2022-03-15 17:09:12 +08:00

22 lines
No EOL
530 B
C++

/*
* @Author: iR
* @Date: 2022-03-15 16:47:44
* @LastEditors: iR
* @LastEditTime: 2022-03-15 16:52:26
* @FilePath: \Code\1-1c\main.cpp
* @Description:
* @Mail: i@iridium.cyou
*/
#include "../inc/matrix.hpp"
#include <stdio.h>
int main()
{
int data[] = {1, 2, 3, 4};
Matrix<int> b;
Matrix<int> a(2, 2, data);
b = a;
a.at(0, 0) = 5;
printf("[%d,%d,%d,%d]\n", a.at(0, 0), a.at(0, 1), a.at(1, 0), a.at(1, 1));
printf("[%d,%d,%d,%d]", b.at(0, 0), b.at(0, 1), b.at(1, 0), b.at(1, 1));
return 0;
}