- #include <string.h>
- #include <stdio.h>
- static int f(unsigned char *p)
- {
- //unsigned short result;
- //memcpy(&result, p, 2);
- //return result;
- return (p[1] << 8) | p[0];
- }
- char input[10000000];
- int main(void)
- {
- long i, j, total = 0;
- for (i = 0; i < 100; i++) {
- for (j = 0; j < sizeof(input) - 1; j++)
- total += f(input + j);
- printf("[%ld]", total);
- }
- printf("\n");
- }