如果有相应的OJ题目,欢迎同学们提供相应的链接

相关链接

简单的测试

INPUT:
1 2 3 1
3 4 3 -1
OUTPUT:
+ 4 3
6 3
- -2 1
0 5
x 8 -1
18 -1

代码模板

const int MAXN=1;    #modify here
const int MAXM=1; #modify here
struct Matrix{
int n,m;
int a[MAXN][MAXM];
void clear(){
n=m=0;
memset(a,0,sizeof(a));
} Matrix operator +(const Matrix &b) const{
Matrix tmp;
tmp.n=n;tmp.m=m;
for(int i=0;i<n;i++)
for(int j=0;j<m;j++)
tmp.a[i][j]=a[i][j]+b.a[i][j];
return tmp;
}
Matrix operator -(const Matrix &b) const{
Matrix tmp;
tmp.n=n;tmp.m=m;
for(int i=0;i<n;i++)
for(int j=0;j<m;j++)
tmp.a[i][j]=a[i][j]-b.a[i][j];
return tmp;
}
Matrix operator *(const Matrix &b) const{
Matrix tmp;
tmp.clear();
tmp.n=n;tmp.m=b.m;
for(int i=0;i<n;i++)
for(int j=0;j<b.m;j++)
for(int k=0;k<m;k++)
tmp.a[i][j]+=a[i][k]*b.a[k][j];
return tmp;
}
};

最新文章

  1. webform Repeater重复器、地址栏传值、Response
  2. 多人开发Xcode工程冲突,打不开解决办法
  3. Google Maps地图投影全解析(3):WKT形式表示
  4. C/C++程序员必须熟练应用的开源项目[转]
  5. iOS-----类和对象,nil/Nil/NULL的区别
  6. java 14 -10 Calendar类以及练习
  7. ActiveMQ点对点的消息发送案例
  8. MAX-HEAPIFY(2/3n的疑惑)
  9. Centos7下建立rubymine快捷方式到侧栏或桌面
  10. JavaMail邮件发送不成功的那些坑人情况及分析说明
  11. Bootstrap3 表格-紧缩表格
  12. Oracle EBS json
  13. Java面试总结之AIO与NIO
  14. 简述servlet
  15. 【SpringBoot系列1】SpringBoot整合MyBatis
  16. 获得discuz7.2 目录下所有文件,并写到txt
  17. 3. Recursive AutoEncoder(递归自动编码器)
  18. Linux下CPU信息的查看
  19. CodeForces - 983B XOR-pyramid(区间dp,异或)
  20. JAVA练手--集合

热门文章

  1. 实用的透明背景mark图标
  2. sphinx (coreseek)——2、区段查询实例
  3. 老oj曼哈顿最小生成树
  4. Redux1
  5. IOS设计模式之三:MVC模式
  6. Hadoop环境搭建-入门伪分布式配置(Mac OS,0.21.0,Eclipse 3.6)
  7. OLAP 大表和小表并行hash join
  8. 如果你不好好玩printf
  9. 解决SecureCRT中文版“数据库里没找到防火墙‘无’”的错误提示
  10. AlgorithmsI PA2: Randomized Queues and Deques Subset