short_min = -32768
short_max = 32767
ushort_max = 65535
int_min = -2147483648
int_max = 2147483647
uint_max = 4296967295
sign = input() -> 0 -- signed or 1 -- unsigned
type = input() -> 0 -- short and 1 -- int
number = input() -> any
if type == 0:
if sign == 0:
if short_min <= number and number <= short_max: -> Ok
if sign == 1:
if 0 <= number and number <= ushort_max: -> Ok
if type == 1:
if sign == 0:
if int_min <= number and number <= int_max: -> Ok
if sign == 1:
if 0 <= number and number <= uint_max: -> Ok
Comments
Leave a comment