multrix/src/main.nim
2022-11-17 21:35:45 -05:00

25 lines
751 B
Nim

import strutils, sequtils, procedures #, strformat
# TODO: check if command was either dot or cross product
echo "Enter number of rows in the first matrix:"
let r1: int = parseInt(readLine(stdin))
echo "Enter number of columns in the first matrix:"
let c1: int = parseInt(readLine(stdin))
var m1 = newSeqWith(r1, newSeq[float](c1))
procedures.fillMatrix(m1, r1, c1)
echo "Enter number of rows in the second matrix:"
let r2: int = parseInt(readLine(stdin))
echo "Enter number of columns in the second matrix:"
let c2: int = parseInt(readLine(stdin))
var m2 = newSeqWith(r2, newSeq[float](c2))
procedures.fillMatrix(m2, r2, c2)
echo "\nFirst matrix is:"
procedures.printMatrix(m1, r1)
echo "\nSecond matrix is:"
procedures.printMatrix(m2, r2)