Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float dataProcessing(FILE *fin) {
- long x,y,summ;
- int counter = 1;
- float result;
- if (fscanf(fin,"%lf",&y)!=1) return -1;
- while(fscanf(fin,"%lf",&x) = 1) {
- if (x!=y) {
- summ += y;
- y = x;
- counter++;
- continue;
- } else {
- y = x;
- }
- }
- result = summ / counter;
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement