Commit 43cda1ed by matjul

Upload New File

parent 732ea521
Showing with 35 additions and 0 deletions
#include <stdio.h>
void meanPoint(float matrix[5][3], float lenghts[3]);
int main(){
float matrix[5][3] = {
{1, 3.1, 21},
{2, -3.2, 23},
{2.3, 12.8, 2},
{2, 1.4, -23},
{12, 2, -2.3}
};
int j;
float lenghts[10] = {0};
meanPoint(matrix, lenghts);
printf("The mean of point of this crap is: " );
for(j = 0; j < 3; j++){
printf("%f, ", lenghts[j]);
}
return 0;
}
void meanPoint(float matrix[5][3], float lenghts[3]){
int i, j;
float len[3] = {0};
for(j = 0; j < 3; j++){
for(i = 0; i < 5; i++){
len[j] += matrix[i][j];
}
lenghts[j] = len[j] / 5;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment