123456789101112131415161718192021222324 |
- #include <stdint.h>
- #include <stdio.h>
- #include <string.h>
- #define SIZE 26
- int main() {
- uint8_t a[SIZE];
- memset(a, 1, SIZE);
- uint32_t result;
- result = 0;
- for (int i = 0; i < SIZE; i++) {
- result += a[i] * (1 << i);
- }
- printf("%u (0x%x)\n", result, result);
- return 0;
- }
|