#34777: C++ 解題方法


raphaelchu0205@gmail.com (Raphael)

學校 : 不指定學校
編號 : 181268
來源 : [125.230.71.195]
最後登入時間 :
2024-01-22 09:11:15
a132. 10931 - Parity -- UVa10931 | From: [111.253.30.151] | 發表日期 : 2023-04-15 23:35

a=1
while 1:
    a=int(input())
    if a==0:
        break
    L1=[]
    L1=list(str(bin(a)))
    L1.remove("b")
    del L1[0]
    print("The parity of","".join(L1),"is",L1.count("1"),"(mod 2).")

C++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

 
ZeroJudge Forum