結果

問題 No.222 引き算と足し算
ユーザー ktshun
提出日時 2015-06-10 20:04:14
言語 Python2
(2.7.18)
結果
AC  
実行時間 11 ms / 1,000 ms
コード長 290 bytes
コンパイル時間 77 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2024-11-15 21:54:33
合計ジャッジ時間 1,493 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding:utf-8 -*-

if __name__ == "__main__":
	S = raw_input()

	for i,s in enumerate(S[1:]):
		if s.isdigit():
			continue
		else:
			ope = s
			ope_num = i + 1
			break
	num1 = int(S[:ope_num])
	num2 = int(S[ope_num+1:])
	if ope == "-":
		print num1 + num2
	else:
		print num1 - num2
0