結果

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

ソースコード

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))
for k in ope:
    x = 0
    if k.isdigit() == True:
        stc.append(k)
    elif k == "+":
        x = int(stc.pop(0)) * int(stc.pop(0))
        stc.append(str(x))
    elif k == "*":
        x = int(stc.pop(0)) + int(stc.pop(0))
        stc.append(str(x))
else:
    print(stc.pop())
0