猫史档案馆


i 的 i 次 方 等 于 多 少

用户:wolffy_officewolffy_office查看:2 回复:2 评论:2 创建时间:2021-08-25T15:56:13


def toi(cm):   #复数处理函数,正文第28行
    c=[]
    s=False
    d=False
    if cm.real==0:
        s=True
    if cm.imag==0:
        d=True
    cm=str(cm)
    for i in range(len(cm)):
        if cm[i]=='j':
            c.append('i')
            continue
        c.append(cm[i])
    if s and d:
        c=['(','0',')']
    else:
        if s:
            while '+' in c or '-' in c:
                del c[1]
        if d:
            while '+' in c or '-' in c:
                del c[-2]
    return(''.join(c))

z=1j 
print(toi(z**z))

center_image

!woc居然是个实数


回复

上一页1 页 / 共 1下一页
一个STUB用户_6923702一个STUB用户_6923702

不会的吧……应该是位数限制?

点赞1


评论


Python-happyyyyPython-happyyyy

center_image

点赞0


评论