結果

問題 No.222 引き算と足し算
ユーザー rocoder
提出日時 2017-06-26 04:36:09
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
実行時間 -
コード長 387 bytes
コンパイル時間 92 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-10-04 07:42:55
合計ジャッジ時間 1,982 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 3
other RE * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

#49 homework arithmetic*+
S=list(input())
i=0
a=[]
j=0
b=[]
while i<len(S):
    while i<len(S) and S[i]!="*" and S[i]!="+":
        a[j].append(S[i])
        i+=1
    b.append(S[i])
    a.append([])
    j+=1
    i+=1
c=[]
for i in range(j-1):
    c.append(int("".join(a[i])))
d=a[0]
for i in range(j-1):
    x=a[i+1]
    y=b[i]
    if y=="*":
        d+=x
    else:
        d*=x
print(d)
0