#26038: 想問錯在哪


zhengyouli547@gmail.com (hahaha)


本來寫這樣

 

 

while True: try: a,b=map(int,input().split());aa=0;t=0 while (aa<b): aa=aa+a a+=1 t+=1 print(t) except: break

#26039: Re:想問錯在哪


zhengyouli547@gmail.com (hahaha)


本來寫這樣

 

 

while True: try: a,b=map(int,input().split());aa=0;t=0 while (aa<b): aa=aa+a a+=1 t+=1 print(t) except: break

後來看討論寫這樣

while True:
    try:
        a,b=map(int,input().split());aa=0;t=0
        if (a<0):
            a=-a
        if (b<0):
            b=-b
        while (aa<b):
            aa=aa+a
            a+=1
            t+=1
        print(t)
    except:
        break
#26040: Re:想問錯在哪


zhengyouli547@gmail.com (hahaha)


本來寫這樣

 

 

while True: try: a,b=map(int,input().split());aa=0;t=0 while (aa<b): aa=aa+a a+=1 t+=1 print(t) except: break

後來看討論寫這樣

while True:
    try:
        a,b=map(int,input().split());aa=0;t=0
        if (a<0):
            a=-a
        if (b<0):
            b=-b
        while (aa<b):
            aa=aa+a
            a+=1
            t+=1
        print(t)
    except:
        break

第一個不知道為什麼跑掉了

while True:
    try:
        a,b=map(int,input().split());aa=0;t=0
        while (aa<b):
            aa=aa+a
            a+=1
            t+=1
        print(t)
    except:
        break