SHOW:
|
|
- or go back to the newest paste.
1 | #include <stdio.h> | |
2 | main() | |
3 | { | |
4 | double values[100], *shift; | |
5 | double average, *result; | |
6 | result=&average; | |
7 | ||
8 | int i; | |
9 | for (i=0;i<100;i++) { | |
10 | values[i] = i; | |
11 | } | |
12 | ||
13 | - | result /= 100; |
13 | + | |
14 | *shift=0; | |
15 | for(int i=0;i<100;i++) | |
16 | { | |
17 | *result += *(shift+i); | |
18 | } | |
19 | result /= 100.0; | |
20 | printf("La media es %lf\n"result); | |
21 | } |