insidcode
ProblemsDuelLeaderboardStats
Sign In
  1. Home
  2. Problems
  3. Take 5 numbers as input. If the user enters 0, skip it using continue. At the end, print the sum of all non-zero numbers entered.

Take 5 numbers as input. If the user enters 0, skip it using continue. At the end, print the sum of all non-zero numbers entered.

Difficulty: Easy

Phase: 6 · Mixed Logical Challenges

XP Reward: 10 XP

Topics: Mixed Logical Challenges, Easy

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

Problem Description

Given N, print Floyd's triangle with consecutive numbers up to N rows. 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: 3

Output: 1 2 3 4 5 6

Explanation: Sample execution for input 3