#include <stdio.h>
#include <iostream>
#include <string>
using namespace std;
int main(void) {
unsigned short t1=0x8000;
if(t1 & 0x8000) {
// t1=t1 & 0x7FFF;
// znak=1;
}
t1=t1<<1;
printf("Do = \%hx \n",t1);
t1=(~t1);
printf("Invert = \%hx \n",t1);
t1=t1>>7;
printf("Sdvig = \%hx \n",t1);
short temp = (short)t1+1;
printf("Result = \%hx \n",temp);
temp=~temp;
printf("invert = \%hx \n",temp);
printf("Try programiz.pro");
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxpb3N0cmVhbT4KI2luY2x1ZGUgPHN0cmluZz4KCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbih2b2lkKSB7CiAgICB1bnNpZ25lZCBzaG9ydCB0MT0weDgwMDA7CiAgICBpZih0MSAmIDB4ODAwMCkgewovLyAgICAgICAgdDE9dDEgJiAweDdGRkY7CiAgICAgICAgCi8vICAgICAgICB6bmFrPTE7CiAgICB9CiAgICB0MT10MTw8MTsKICAgIHByaW50ZigiRG8gPSBcJWh4IFxuIix0MSk7ICAgIAogICAgdDE9KH50MSk7CiAgICBwcmludGYoIkludmVydCA9IFwlaHggXG4iLHQxKTsKICAgIHQxPXQxPj43OwogICAgcHJpbnRmKCJTZHZpZyA9IFwlaHggXG4iLHQxKTsgICAKICAgIHNob3J0IHRlbXAgPSAoc2hvcnQpdDErMTsKICAgIHByaW50ZigiUmVzdWx0ID0gXCVoeCBcbiIsdGVtcCk7CiAgICB0ZW1wPX50ZW1wOwogICAgcHJpbnRmKCJpbnZlcnQgPSBcJWh4IFxuIix0ZW1wKTsKICAgIHByaW50ZigiVHJ5IHByb2dyYW1pei5wcm8iKTsKCiAgICByZXR1cm4gMDsKfQo=