SHARE
TWEET

Untitled

a guest Dec 7th, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2.  
  3. int main(){
  4.     float A[100] = {0.70996857,  0.92153041,  0.57854903,  0.4691858 ,  0.85711789,
  5.         0.83877707,  0.39849402,  0.68383955,  0.68136621,  0.6284173 ,
  6.         0.51861377,  0.27170914,  0.78585464,  0.44336198,  0.12928879,
  7.         0.63625563,  0.6941663 ,  0.97439405,  0.13302003,  0.31861973,
  8.         0.28207465,  0.17955204,  0.80912553,  0.04522409,  0.9000931 ,
  9.         0.4263524 ,  0.51759423,  0.3393523 ,  0.0178972 ,  0.12353849,
  10.         0.95875553,  0.54698017,  0.92126411,  0.13134801,  0.79653216,
  11.         0.64407514,  0.64591454,  0.2055271 ,  0.2672163 ,  0.66766915,
  12.         0.10636448,  0.90115316,  0.85364462,  0.81274756,  0.83190889,
  13.         0.45970623,  0.98262214,  0.88131392,  0.84594881,  0.00214122,
  14.         0.79781057,  0.9512335 ,  0.52196516,  0.26778895,  0.7862288 ,
  15.         0.63646167,  0.47614397,  0.81964891,  0.08854701,  0.27769132,
  16.         0.8427574 ,  0.78530601,  0.13553016,  0.86733545,  0.89529829,
  17.         0.13213601,  0.61716901,  0.780184  ,  0.51085839,  0.1673843 ,
  18.         0.85760473,  0.95170564,  0.32258897,  0.41129952,  0.08774227,
  19.         0.54238957,  0.09085457,  0.92420836,  0.08840577,  0.11536617,
  20.         0.64487682,  0.40857016,  0.74116542,  0.15311164,  0.10098138,
  21.         0.08872571,  0.47577181,  0.4870574 ,  0.69542344,  0.42111143,
  22.         0.27006062,  0.44694793,  0.82579865,  0.21315427,  0.532761  ,
  23.         0.95069867,  0.0028806 ,  0.03852627,  0.69059656,  0.41480079
  24. }
  25. ;
  26.     float *mean;
  27.     float *sum;
  28.     analyze_array(&A);
  29.     printf("Sum is %if, mean is %if", *sum, *mean);
  30.  
  31. }
  32.  
  33.  
  34. void analyze_array(float A[], float *sum, float *mean){
  35. int a, b;
  36.     printf("Wprowadz poczatek i koniec\n");
  37.     scanf("%d %d", &a, &b);
  38.     printf("Poczatek %d \nKoniec %d\n", a, b);
  39.     if (a<=b){
  40.             sum=(sum+A[a]);
  41.             a++;
  42.             }
  43. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top