Ex. 6.4 — File I/O, arrays, and loops
You cannot submit for this problem because the homework's deadline is due.
Upload file
Just compress your ex4.c
, which has #include "assignment.h"
and doesn't has main()
function and has function prototype as void ex4()
, and upload the compressed zip
Description
Read two matrices \(A\) and \(B\) from a text file called matrices.txt
. Compute \(A + B\), \(A \cdot B\) and \(A^T \cdot B^T\). Output the result into a text file named result.txt
. Each row of a matrix is represented as a list of integers separated by a space. When the end of a row is reached a new one starts on the next line. Two matrices are separated by a blank line.
Format
Files
You should submit a tar file containing a c source file ex4.c
, which contains a function void ex4()
that realizes the requirement as is specified in the description.
Input Files
two matrices in matrices.txt
with order \(n \leqslant 500\)
Output Files
the result in result.txt
Sample 1
Input: matrices.txt
-80 8
21 9
-63 -85
81 -44
Output: result.txt
-143 -77
102 -35
5688 6448
-594 -2181
3255 -7404
-1269 252
Limitation
1s, 32MiB for each test case #1 - #9.
2.5s, 32MiB for test case #10.
Homework 6 (Individual)
- Status
- Finished
- Problems
- 6
- Open Since
- 2019-11-03 00:00
- DDL
- 2019-11-08 23:59
- Extension
- 240.0 hour(s)