daily pastebin goal
87%
SHARE
TWEET

Прога на Си на среднее арифмитесечкое постоянных.

a guest Sep 14th, 2018 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. float dataProcessing(FILE *fin) {
  2.     long x,y,summ;
  3.     int counter = 1;
  4.     float result;
  5.     if (fscanf(fin,"%lf",&y)!=1) return -1;
  6.    
  7.     while(fscanf(fin,"%lf",&x) = 1) {
  8.         if (x!=y) {
  9.             summ += y;
  10.             y = x;
  11.             counter++;
  12.             continue;
  13.         } else {
  14.             y = x;
  15.         }
  16.     }
  17.     result = summ / counter;
  18.     return result;
  19. }
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
 
Top