#include #include typedef double R; typedef struct{R* a; int m; int n;} mat; // a[m, n] void mm(mat const a, mat const b, mat const c){ if(!(b.n == c.m && a.m == b.m && a.n == c.n)) exit(printf("vit\n")); int i = a.m; while(i--){int j=a.n; while(j--){ R s = 0; {int k=b.n; while(k--) s += b.a[i*b.n+k]*c.a[k*c.n+j];} a.a[i*a.n+j] = s;}}} void pm(mat a, char * q){int i, j; printf("%s: %d by %d\n", q, a.m, a.n); for(i=0; i