結果

問題 No.49 算数の宿題
ユーザー YCesca
提出日時 2016-09-08 14:58:24
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 662 bytes
コンパイル時間 152 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-12-23 01:53:34
合計ジャッジ時間 1,039 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

s = input()
stc = []
stc2 = []
ope = []
for i in s:
    if i.isdigit() == True:
        stc.append(i)
    else:
        ope.append("".join(stc))
        stc = []
        stc2.append(i)
else:
    ope.append("".join(stc))
    stc = []
    for j in range(len(stc2)):
        ope.append(stc2.pop(0))
print(ope)
for k in ope:
    x = 0
    if k.isdigit() == True:
        stc.append(k)
        print(stc)
    elif k == "+":
        x = int(stc.pop(0)) * int(stc.pop(0))
        stc.append(str(x))
        print(stc)
    elif k == "*":
        x = int(stc.pop(0)) + int(stc.pop(0))
        stc.append(str(x))
        print(stc)
else:
    print(stc.pop())
            
0