total = 0 while True: num = int(input("整数?[0で終了]")) if num == 0: break total += num print(f"合計は{total}です!") # プログラム6-8(入力された整数の合計)