Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
#include "Matrix.h" #include
#include
using namespace std; int main(){ int r1, c1, r2, c2; double num; while(cin >> r1 >> c1){ vector
coef1, coef2; for(int i=0; i
> num; coef1.push_back(num); } Matrix m1(r1, c1, coef1); cin >> r2 >> c2; for(int i=0; i
> num; coef2.push_back(num); } Matrix m2(r2, c2, coef2); if(m1.isAddable(m2)){ Matrix res = m1+m2; cout << "m1 + m2=" << endl; res(); }else{ cout << "m1 and m2 are not addable." << endl; } if(m1.isSubstractable(m2)){ Matrix res = m1-m2; cout << "m1 - m2=" << endl; res(); }else{ cout << "m1 and m2 are not substractable." << endl; } if(m1.isMultipliable(m2)){ Matrix res = m1*m2; cout << "m1 * m2=" << endl; res(); }else{ cout << "m1 and m2 are not multipliable." << endl; } } return 0; }
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)