0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Python演習問題_0【 計算のキホン 】

Last updated at Posted at 2023-06-30

計算

出力

問題:以下の条件に従って、2つの整数を入力し、それらを足した結果を表示するプログラムを作成してください。

プログラムは、ユーザーから2つの整数を入力するように要求します。
ユーザーが入力した整数を足し合わせ、その結果を出力します。
出力されるメッセージは、「入力した2つの整数の和は[結果]です」としてください。
入力値が整数以外の場合、プログラムは「整数を入力してください。」とメッセージを出力し、再度入力を求めるようにしてください。

【 例1 】
最初の整数を入力してください:5
2番目の整数を入力してください:7
入力した2つの整数の和は12です。
【 例2 】
最初の整数を入力してください:abc
整数を入力してください。
最初の整数を入力してください:3
2番目の整数を入力してください:def
整数を入力してください。
2番目の整数を入力してください:5
入力した2つの整数の和は8です。
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?