通過UVa Online Judge
import sys
for line in sys.stdin:
a, b = line.split()
a = int(a)
b = int(b)
print(abs(a-b))
參考資料:a012: Hashmat的戰役 - 高中資訊科技概論教師黃建庭的教學網站 (google.com)
通過瘋狂程設
a = 0
b = 0
flag = True
while 1:
for x in input().split():
if flag == True:
a = int(x)
flag = not flag
else:
b = int(x)
print(abs(a-b))
flag = not flag
* 瘋狂程設會出現不換行的情況
歡迎指教
覺得腦袋一片混亂
0 comments:
張貼留言