Practice

Three-Digit Number Breakdown

2022/Oct/Nov·Variant 2
EASYArithmetic

Write an algorithm to divide a three-digit number into its hundreds, tens, and units components using the built-in mathematical operators DIV (integer division) and MOD (remainder).

Input: A single positive integer between 100 and 999. Output: A single line in the format: "Hundreds: H Tens: T Units: U"

Example:

Input:  876
Output: Hundreds: 8 Tens: 7 Units: 6
Premium is coming soon. All grading features are currently unlocked.

Sample Test Cases

Test 1: Standard 3-digit number
Inputs: 876
Expected: Hundreds: 8 Tens: 7 Units: 6
Test 2: Zero in tens place
Inputs: 606
Expected: Hundreds: 6 Tens: 0 Units: 6
Press Ctrl+Enter to run your code
or Ctrl+Shift+Enter to grade