PHP- Kodu:
#include <stdio.h>
#include <stdlib.h>
int mv(int *v, int *z, int **A, int m, int n) {
int i,j;
for (i=0;i<m;i++) {
z[i] = 0;
for (j=0;j<n;j++)
z[i] += A[i][j] * v[j];
}
}
int main(void) {
int i, j, m, n, *v, *z, **A;
printf("n=");scanf("%d",&n);
printf("m=");scanf("%d",&m);
v = (int*) malloc (n * sizeof(int));
z = (int*) malloc (m * sizeof(int));
A = (int**) malloc (m * sizeof(int*));
for (i=0;i<m;i++)
A[i] = (int*) malloc (n*sizeof(int));
for (i=0;i<n;i++) {
printf("v[%d]=",i);scanf("%d",&v[i]);
}
for (i=0;i<m;i++)
for (j=0;j<n;j++) {
printf("A[%d][%d]=",i,j);scanf("%d",&A[i][j]);
}
mv(v, z, A, m, n);
for (i=0;i<m;i++)
printf("%d ",z[i]);
for (i=0;i<m;i++)
free(A[i]);
free(A);
free(v);
free(z);
return 0;
}