Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main() {
- size_t size = 100;
- char p[size], *pp = p;
- int num = 0, x, ant = -1;
- double sum = 0;
- while(getline(&pp, &size, stdin) != EOF) {
- scanf("%d", &x);
- if(x == ant) continue;
- ant = x, sum += x, ++num;
- }
- printf("%.1lf\n", sum / num);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement