insidcode
ProblemsDuelLeaderboardStats
Sign In
  1. Home
  2. Problems
  3. Print numbers between 1–100 whose digits add up to a multiple of 3.

Print numbers between 1–100 whose digits add up to a multiple of 3.

Difficulty: Medium

Phase: 6 · Mixed Logical Challenges

XP Reward: 20 XP

Topics: Mixed Logical Challenges, Medium

Supported Languages: Python, JavaScript, C, C++, Java

Problem Description

Print all numbers between 1 and 50 whose digits add up to a multiple of 3, separated by space. Input Format: Read input from standard input (stdin). Output Format: Print the result to standard output (stdout).

Constraints

  • -10^9 <= N <= 10^9

Examples

Example 1

Input:

Output: 3 6 9 12 15 18 21 24 27 30 33 36 39 42 45 48

Explanation: Sample execution for input (no input)