Digital-Systems-Assignments/Assignment 7/main.c
Shaquille Soekhlal 957e7d3ed0 Stuff, Things
2019-10-11 22:34:52 +02:00

33 lines
622 B
C

/*
* Student: S.K. Soekhlal
* Number: 4860632
* Assignment: 4.3
*/
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main(){
int m,n,i,j,c;
double price[100] = {0};
int matrix[100][100];
scanf("%d",&n);
for(i = 0; i<n; i++){
scanf("%lf", &price[i]);
}
scanf("%d",&m);
for(j = 0; j<m; j++){
for (c = 0; c < n; c++){
scanf("%d",&matrix[c][j]);
}
}
for (j = 0; j<m; j++){
float total = 0;
for(c = 0; c < n; c++){
total += matrix[c][j]*price[c];
}
printf("%.2f\n", total);
}
return 0;
}