#include <stdio.h> #include <stdint.h> uint32_t convert_endian(uint32_t value) { uint32_t temp; temp = (value << 24); temp |= ((value & (0xFF << 8)) << 8); temp |= ((value & (0xFF << 16)) >> 8); temp |= ((value >> 24)); return temp; } int main() { uint32_t val; scanf("%u", &val); printf("%u", convert_endian(val)); return 0; }
Test Cases
Test Results
Input
305419896
Expected Output
2018915346