Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(){
- float A[100] = {0.70996857, 0.92153041, 0.57854903, 0.4691858 , 0.85711789,
- 0.83877707, 0.39849402, 0.68383955, 0.68136621, 0.6284173 ,
- 0.51861377, 0.27170914, 0.78585464, 0.44336198, 0.12928879,
- 0.63625563, 0.6941663 , 0.97439405, 0.13302003, 0.31861973,
- 0.28207465, 0.17955204, 0.80912553, 0.04522409, 0.9000931 ,
- 0.4263524 , 0.51759423, 0.3393523 , 0.0178972 , 0.12353849,
- 0.95875553, 0.54698017, 0.92126411, 0.13134801, 0.79653216,
- 0.64407514, 0.64591454, 0.2055271 , 0.2672163 , 0.66766915,
- 0.10636448, 0.90115316, 0.85364462, 0.81274756, 0.83190889,
- 0.45970623, 0.98262214, 0.88131392, 0.84594881, 0.00214122,
- 0.79781057, 0.9512335 , 0.52196516, 0.26778895, 0.7862288 ,
- 0.63646167, 0.47614397, 0.81964891, 0.08854701, 0.27769132,
- 0.8427574 , 0.78530601, 0.13553016, 0.86733545, 0.89529829,
- 0.13213601, 0.61716901, 0.780184 , 0.51085839, 0.1673843 ,
- 0.85760473, 0.95170564, 0.32258897, 0.41129952, 0.08774227,
- 0.54238957, 0.09085457, 0.92420836, 0.08840577, 0.11536617,
- 0.64487682, 0.40857016, 0.74116542, 0.15311164, 0.10098138,
- 0.08872571, 0.47577181, 0.4870574 , 0.69542344, 0.42111143,
- 0.27006062, 0.44694793, 0.82579865, 0.21315427, 0.532761 ,
- 0.95069867, 0.0028806 , 0.03852627, 0.69059656, 0.41480079
- }
- ;
- float *mean;
- float *sum;
- analyze_array(&A);
- printf("Sum is %if, mean is %if", *sum, *mean);
- }
- void analyze_array(float A[], float *sum, float *mean){
- int a, b;
- printf("Wprowadz poczatek i koniec\n");
- scanf("%d %d", &a, &b);
- printf("Poczatek %d \nKoniec %d\n", a, b);
- if (a<=b){
- sum=(sum+A[a]);
- a++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement