CodeDrill
day_streak: --
← 問題一覧に戻る
Python ・ Standard I/O

Problem 13: Quotient and Remainder

From standard input, two integers A and B are given on one line, separated by a single space. Output the quotient and remainder of A divided by B, separated by a single space, on one line.

For example, if A is 7 and B is 3, the quotient is 2 and the remainder is 1, so you output 2 1.

Constraints

1 ≤ A ≤ 1000, 1 ≤ B ≤ 1000

Input example 1

7 3

Output example 1

2 1

Input example 2

10 5

Output example 2

2 0

What you'll train

Specify the output

What you get

  • Specify the output order
  • Specify the delimiter
  • Explain the calculation method

How to ask the AI

Clearly state the order in which to output the quotient and remainder, separated by a single space. Also specifying how to handle negative values of A and B helps prevent mistakes.

If you ask vaguelyWhen negative numbers are involved, Python's behavior for // and % might not match the intended definition of quotient and remainder.

あなたのコード

実行しました

プレビュー

AIレビュー(プロンプト練習)

コードはChatGPTやClaudeに出させたものを貼って構いません。
ここでの本番は「次にAIへ出す指示」です。評価軸は1つだけ見て、弱点・指示の穴・改善例を返します。
テストに落ちていてもレビューできます。落ちた理由と、指示に足りなかった情報を結びつけます。

先にコードを実行し、テストを1つ以上通してください。