結果

問題 No.222 引き算と足し算
ユーザー tyuiss
提出日時 2015-06-05 22:52:10
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 30 ms / 1,000 ms
コード長 238 bytes
コンパイル時間 304 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-11-15 21:26:24
合計ジャッジ時間 2,315 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

ss = input()

x = ss[0]
op = ""
y = ""
for i in range(1, len(ss)):
    if(ss[i] == "+" or ss[i] == "-"):
        break
    x += ss[i]

op = ss[i]

y = ss[i + 1:]

if op == "+":
    print(int(x) - int(y))

else:
    print(int(x) + int(y))
0