Quizes
Problems
Courses
Sign
Register
Main
/
Courses
/
Basic of Java
/
№ 10
/21
Modeling Machine
Read Theory
Task
Time limit:
1000
ms,
Memory limit:
256 Mb
Write a program that simulates the operation of the next machine. The machine receives a three-digit number at the input and builds a new number as follows:
1) the sums of the first and second digits are calculated, then the second and third digits;
2) these amounts are recorded in non-increasing order.
For example, for the number 639 we get the sums: 6 + 3 = 9; 3 + 9 = 12. Result: 129
Write a program that implements the work of this machine
Input
: one number is input to the program
n
\((100<=n <=999)\)
Output
: need to output a new number
Example
Input
654
Output
119
Auto
CHOOSE THE PROGRAMMING NECESSARY LANGUAGE!
Attach the program source file:
or enter the source code in the language:
C++
Python
FreePascal
PascalABC.Net
Kumir
Java
JavaScript
TypeScript
C#
F#
Swift
Rules for designing programs and a list of errors during automatic task verification
Results: