#include <iostream>
#include <netinet/in.h>
using namespace std;
int main() {
auto i = ntohs(64);
cout << i << endl;
i = htons(0x8100);
cout << i << endl;
short int x = 0x8100;
i = (((x) & 0xff00) >> 8) | (((x) & 0x00ff) << 8);
cout <<"flip" << i<<endl;
i = ntohs(59151);
cout << 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;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8bmV0aW5ldC9pbi5oPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKCkgewoJYXV0byBpID0gbnRvaHMoNjQpOwogICAgY291dCA8PCBpIDw8IGVuZGw7CiAgICAKICAgIGkgPSBodG9ucygweDgxMDApOwogICAgY291dCA8PCBpIDw8IGVuZGw7CiAgICBzaG9ydCBpbnQgeCA9IDB4ODEwMDsKICAgIGkgPSAoKCh4KSAmIDB4ZmYwMCkgPj4gOCkgfCAoKCh4KSAmIDB4MDBmZikgPDwgOCk7CiAgICBjb3V0IDw8ImZsaXAiIDw8IGk8PGVuZGw7CiAgICBpID0gbnRvaHMoNTkxNTEpOwogICAgY291dCA8PCBpIDw8IGVuZGw7CiAgICAKICAgIGkgPSBudG9obCgweDkzMDAwMDAwKTsKICAgIGNvdXQgPDwgaSA8PCBlbmRsOwogICAgCiAgICBpID0gbnRvaGwoMHg4ZDAwMDAwMCk7CiAgICBjb3V0IDw8IGkgPDwgZW5kbDsKICAgIAogICAgaSA9IG50b2hsKDB4NjcwMDAwMDApOwogICAgY291dCA8PCBpIDw8IGVuZGw7CiAgICAKICAgIGkgPSBudG9obCgweDQxMDAwMDA3KTsKICAgIGNvdXQgPDwgaSA8PCBlbmRsOwogICAgCiAgICBpID0gbnRvaGwoMHgwMDAwMDA1Zik7CiAgICBjb3V0IDw8IGkgPDwgZW5kbDsKICAgIAoJcmV0dXJuIDA7Cn0=