Loop statement with condition - while




Task
Time limit: 1000 ms,
Memory limit: 256 Mb

Given a sequence of non-zero integers ending in zero (zero is not included in the sequence). It is necessary to find the distance (modulo) between the first minimum and the first maximum number of the sequence.
Input: integers (one number per line) are input
Output: print the answer to the problem

Example
Input Output
1 -1
-2
1
7
2
0
2

Prohibited statements:list;[;max;min

Auto CHOOSE THE PROGRAMMING NECESSARY LANGUAGE!
Attach the program source file:
or enter the source code in the language:

Rules for designing programs and a list of errors during automatic task verification
           

Results: