Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include "stuff.h"
- int main() {
- int matrices = 0;
- fscanf(stdin, "%d", &matrices);
- int R=0, C=0;
- fscanf(stdin, "%d %d", &R, &C);
- double **result = mread(stdin, &R, &C);
- while(matrices>1) {
- int nextR=0, nextC=0;
- fscanf(stdin, "%d %d", &nextR, &nextC);
- double **next = mread(stdin, &nextR, &nextC);
- result = mmult(R,C,result,nextR,nextC,next);
- xfree(nextR,nextC,next);
- C=nextC;
- matrices--;
- }
- mwrite(stdout,R,C,result);
- xfree(R,C,result);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement