In one line of the screen, a sequence of characters (type char) is entered. Input is completed by pressing the Enter key. Print, preserving the sequence, numbers, followed by the "=" symbol and a sequence of characters that represent the sum of all numbers. Display the "+" symbol between the numbers. Arrays do not use. Work in delphi. Prompt the course of writing this program. I will be grateful.

  • @ Alexander009, According to the rules of the forum, questions should not be reduced to the decision or the completion of student assignments. Please clarify what you have done yourself and what did not work out. - DreamChild
  • @ Alexander009, Try to write more detailed questions. Explain what you see the problem, how to reproduce it, etc. - smackmychi

1 answer 1

Tell me the course of writing this program

If only a move ...

  1. Write the input to the string (ah-ah-ah ... the string is also an array. But alas. Without it, only by working with an I / O stream).
  2. Go successively along this line, in a try-except block, trying to execute StrToInt.
    If successful, increase the amount by the given number, and the answer line - to the read character. In case of failure, catch the exception and move forward one character further.
  3. Do the inverse IntToStr transform.
  4. Print the answer line, =, the converted number.

Profit.

NB: IDE is called Delphi .