练这题主要是为了练习参数初始化表定义法。
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string>
#include <cstring>
#include <vector>
#include <stack>
#include <cctype>
#include <cmath>
#include <climits>
using namespace std;
const int MAXN = 1005;
const int INF = INT_MAX;
struct Matrix{
int maritx[10][10];
int row;
int col;
Matrix(int r, int c) : row(r), col(c) {}//注意这里没有封号!(参数初始化表定义法)
};
Matrix Plus(Matrix x, Matrix y){
Matrix z(x.row, x.col);
for(int i = 0; i < x.row; i++){
for(int j = 0; j < x.col; j++){
z.maritx[i][j] = x.maritx[i][j] + y.maritx[i][j];
}
}
return z;
}
int main(){
// freopen("in.txt", "r", stdin);
int M, N;
while(~scanf("%d", &M)){
if(M == 0) break;
scanf("%d", &N);
Matrix x(M, N);
Ma