 Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
..
Failed to load latest commit information. 01. Exchange if greater 02. Multiplication Sign 03. The biggest of Three 04. Sort 3 numbers 05. Digit as word 06. Quadratic equation 07. The biggest of five numbers 08. Number as words README.md

# Homework: Conditional statements

================================

# 01. Exchange if greater

## Description

Write an `if` statement that takes two double variables `a` and `b` and exchanges their values if the first one is greater than the second. As a result print the values `a` and `b`, separated by a space.

## Input

• The input will consist of an array containing two values - `a` and `b` represented as strings

## Output

• The output should be a single line containing two numbers

## Constraints

• Time limit: 0.2s
• Memory limit: 16MB

# 02. Multiplication Sign

## Description

Write a script that shows the sign (`+`, `-` or `0`) of the product of three real numbers, without calculating it. Use a sequence of `if` operators.

## Input

• The input will consist of an array containing three values - `a`, `b` and `c` represented as strings

## Output

• The output should be a single line containing `+`, `-` or `0`

## Constraints

• Time limit: 0.2s
• Memory limit: 16MB

# 03. The biggest of Three

## Description

Write a script that finds the biggest of three numbers. Use nested `if` statements.

## Input

• The input will consist of an array containing three values represented as strings

## Output

• The output should be a single line containing a number

## Constraints

• Time limit: 0.2s
• Memory limit: 16MB

# 04. Sort 3 numbers

## Description

Sort 3 real values in descending order. Use nested `if` statements.

Note: Don’t use arrays and the built-in sorting functionality.

## Input

• The input will consist of an array containing three values represented as strings

## Output

• The output should be a single line containing three numbers separated by spaces

## Constraints

• Time limit: 0.2s
• Memory limit: 16MB

# 05. Digit as word

## Description

Write a script that asks for a digit `(0-9)`, and depending on the input, shows the digit as a word (in English). Print `not a digit` in case of invalid input. Use a `switch` statement.

## Input

• The input will consist of an array containing a single string

## Output

• The output should be a single line

## Constraints

• Time limit: 0.2s
• Memory limit: 16MB

## Description

Write a script that reads the coefficients `a`, `b` and `c` of a quadratic equation `ax2 + bx + c = 0` and solves it (prints its real roots). Calculates and prints its real roots.

Note: Quadratic equations may have 0, 1 or 2 real roots.

## Input

• The input will consist of an array containing three values - `a`, `b` and `c` represented as strings

## Output

• The output should be a single line containing the real roots (see sample tests)
• Print numbers with two digits of precision after the floating point
• If there are two roots then `x1 < x2`

## Constraints

• Time limit: 0.2s
• Memory limit: 16MB

# 07. The biggest of five numbers

## Description

Write a script that finds the biggest of given 5 variables. Use nested `if` statements.

## Input

• The input will consist of an array containing five values represented as strings

## Output

• The output should be a single line containing the answer

## Constraints

• Time limit: 0.2s
• Memory limit: 16MB

# 08. Number as words

## Description

Write a script that converts a number in the range `[0…999]` to words, corresponding to its English pronunciation.

## Input

• The input will consist of an array containing the number as a string

## Output

• The output should be a single line containing the answer

## Constraints

• Time limit: 0.2s
• Memory limit: 16MB