[题解]Let’s Celebrate the 100th Contest on ZOJ! » ZOJ3437hsys

ZOJ3437hsys
ZOJ3437hsys.py


import sys

for i in sys.stdin :
    args = i.strip().split()
    x = int(args[2], int(args[1]))
    if args[0] == '~' :
        x = ~x
    elif args[0] == '!' :
        x = int(not x)
    else :
        x = -x
    print x
Leave a Reply