Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Programming to find the maximum number of short integers
Programming to find the maximum number of short integers
//The unsigned maximum number can be obtained by inverting 0 bit by bit.

Master ()

{

Cout & lt& lt (unsigned) (~ 0);

}

//The largest signed positive number. After inverting 0 bit by bit, set the highest bit to 0.

//XOR with 1000 ... 0000 is available.

primary

{

cout & lt& lt((~0)^( 1<; & lt(8 * sizeof(int)- 1));

}

There may be a shorter expression to find the maximum number of symbols, but I can achieve it.