From 1d052eb906c39f88bcccbc74d98e85083aa0b06a Mon Sep 17 00:00:00 2001 From: Xike Wang Date: Fri, 26 Sep 2014 14:05:46 -0300 Subject: [PATCH] Fix #1: Add a function mean() --- mm | Bin 0 -> 8808 bytes mm.c | 12 ++++++++++++ 2 files changed, 12 insertions(+) create mode 100755 mm diff --git a/mm b/mm new file mode 100755 index 0000000000000000000000000000000000000000..95e9b8390a653f01f648c3b39243b2b42dcd47c0 GIT binary patch literal 8808 zcmeHNUu+ab7@un?lv3O)X$(dPYeNZEZFvyWPzYCLVH+ubs}d3%u6NtsCHK#}J!w&r zHbCNLb9xUZzWGReG3kpBU_y$JPDV=Rnxx`nZeOht{c7m#!$&W{Wp&`xT{4pVER zgc{*LBI4N&1Dua&Cq^2(i1B3DD-y#u26xzMspH%SDyQn? ztJstma$YctqlG6;e!d@`bNDvO9xiqVv`W5Z|A>z#j8x9Zqm!TSzU1qd1carlPRk1a zVg)mw%#6$ae!fkLs8`vyk_J>9S$8up31Up)JScwKJJGbvt}Opj($ zJZI*g%IDJ1#&^e(Ra#H)zTtd4>)CcI_`(=Z{<(aF{e12oA%4zN(SP$#m3%67h7k7h z(R0x%G)}hsoE{uH^tQHd$bH6CU)+F65^_$~wvklvF>0>Fb9LP+R&~2rw^v)*eN?Jcso2{60j;8ZO5ct*wMQWowJpeGdr7u0 zL2C3Zk3Ptuest>kn6hObW5ln#HwzPsR`J1t(xKIFYV%H~`2p>LQlf82J*Lg;_VD6@ z(z9xMK?x7n7nBoo=sjGwwfPpZYiaYf?_md84ceYzkiCBmW`y)ATP_f(u&1A&k4R5o z7Bj0)pIf9ab*0pcTrch10HoV3OQPu4ZLO}`;Tcx_3YIXE=3{AhYM%kx+Tv@D{i+@t zuIktBHR;x^>IJmvh>*UAtST3~9OApwY`0wU6CXyqrTy%kdQ~YQK1{z#1SD7Riv{MK z>FTjL-Nv%myKhyu(%|o8j4D>=wA+bdG6P@rEBLJ>H@1TbA|{m!X}7(;TqR%ZmKoU{PGBQp z>F3CgKmUTVv~v-|7L=2-nBCk=s45N7j?nErABvHCu@x}$4okZMJDpIutEtUmYw722 zL{42VFLfV5@1^czA|Da?yT}n`k42S>Ac6R%&ds+p{*8kuZyJfTMO{7eOSR2voA3D?vjrcvj2~LoBODvUm zpM4!AC3+Vnp*p=Av}0sgjHXtnLeU}#ojt}v6X8&}eNAgwM8#=;R{j7ssQY7Cw#xUp z4YGXJ_&^^-Ac#N^fgl1w1cC?z5eOm>L?DPj5P={9K?H&b{Pz*)=u$_>i;f7VtMIsy z&*#|De7GzzomsGQgl^izO*tRMHiS7r9kj`TW=Opfu*!|xD9UehVU4`sK?!^%w9`fO%K77K5Px~-U z#=Q$(i#nYdLLzhk=>BiQt5Z!c literal 0 HcmV?d00001 diff --git a/mm.c b/mm.c index ff1779f..1be58d5 100644 --- a/mm.c +++ b/mm.c @@ -12,6 +12,15 @@ int numcmp (const void *a, const void *b) { return 0; } +float mean(int *num, int length) { + float sum = 0; + int i; + for(i=0; i