Skip to content

Commit

Permalink
fixed smuos#2
Browse files Browse the repository at this point in the history
  • Loading branch information
Rayls committed Sep 25, 2014
1 parent d5874f2 commit ca601d5
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions mm.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,19 @@ int numcmp (const void *a, const void *b) {
return 0;
}

int mean(int* pt,int length) {

int i = 0;
int sum = 0;
int mean = 0;
for(i = 0; i < length; i++){
sum = sum + pt[i];
}
mean = (sum / length);

return mean;
}

int main(int argc, char *argv[]) {

int i, length, *pt;
Expand Down Expand Up @@ -46,7 +59,12 @@ int main(int argc, char *argv[]) {
for (i=0; i<length; i++) {
fprintf(stdout, "%d ", pt[i]);
}

fprintf(stdout, "\n%s: FIN. \n", argv[0]);

/* call mean() */
/*mean(pt, length); */

return 0;
}

0 comments on commit ca601d5

Please sign in to comment.