#include <iostream>
#include <netinet/in.h>
using namespace std;
int main() {
const uint8_t bytes[4] = {0x00, 0x01, 0x02, 0x03};
uint32_t n = *(uint32_t*)(void*)bytes;
cout << hex << n << endl;
auto i = htonl(n);
cout << hex << i << endl;
i = ntohl(i);
cout << hex << i << endl;
i = ntohl(0x93000000);
cout << i << endl;
i = ntohl(0x8d000000);
cout << i << endl;
i = ntohl(0x67000000);
cout << i << endl;
i = ntohl(0x41000007);
cout << i << endl;
i = ntohl(0x0000005f);
cout << i << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8bmV0aW5ldC9pbi5oPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKCkgewoJY29uc3QgdWludDhfdCBieXRlc1s0XSA9IHsweDAwLCAweDAxLCAweDAyLCAweDAzfTsKCXVpbnQzMl90IG4gPSAqKHVpbnQzMl90Kikodm9pZCopYnl0ZXM7Cgljb3V0IDw8IGhleCA8PCBuIDw8IGVuZGw7IAoJCglhdXRvIGkgPSBodG9ubChuKTsKICAgIGNvdXQgPDwgaGV4IDw8IGkgPDwgZW5kbDsKICAgIAogICAgaSA9IG50b2hsKGkpOwogICAgY291dCA8PCBoZXggPDwgaSA8PCBlbmRsOwogICAgCiAgICBpID0gbnRvaGwoMHg5MzAwMDAwMCk7CiAgICBjb3V0IDw8IGkgPDwgZW5kbDsKICAgIAogICAgaSA9IG50b2hsKDB4OGQwMDAwMDApOwogICAgY291dCA8PCBpIDw8IGVuZGw7CiAgICAKICAgIGkgPSBudG9obCgweDY3MDAwMDAwKTsKICAgIGNvdXQgPDwgaSA8PCBlbmRsOwogICAgCiAgICBpID0gbnRvaGwoMHg0MTAwMDAwNyk7CiAgICBjb3V0IDw8IGkgPDwgZW5kbDsKICAgIAogICAgaSA9IG50b2hsKDB4MDAwMDAwNWYpOwogICAgY291dCA8PCBpIDw8IGVuZGw7CiAgICAKCXJldHVybiAwOwp9