View Code of Problem 3307

l = input().split(',')
x = int(l[1])
y = int(l[2])
s = list(bin(int(l[0],16))[2:])
a = list('0'*32)
j=0
for i in range(32-len(s),32):
    a[i]=s[j]
    j+=1
x = x+1
y = y+1
a[-x] ='0'
a[-y:-y+3]='110'
s = ''.join(a)
t = int(s,2)
print(hex(t)[2:])

/*
F:\temp\22495050.28580\Main.cc:15:5: error: empty character constant
F:\temp\22495050.28580\Main.cc:2: error: expected constructor, destructor, or type conversion before '=' token
*/

Double click to view unformatted code.


Back to problem 3307