How to resolve the algorithm A+B step by step in the ERRE programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm A+B step by step in the ERRE programming language

Table of Contents

Problem Statement

A+B   ─── a classic problem in programming contests,   it's given so contestants can gain familiarity with the online judging system being used.

Given two integers,   A and B. Their sum needs to be calculated.

Two integers are written in the input stream, separated by space(s):

The required output is one integer:   the sum of A and B.

Let's start with the solution:

Step by Step solution about How to resolve the algorithm A+B step by step in the ERRE programming language

Source code in the erre programming language

PROGRAM SUM2

BEGIN

  LOOP
    INPUT(LINE,Q$)
    EXIT IF Q$=""
    SP%=INSTR(Q$," ")
    PRINT(VAL(LEFT$(Q$,SP%-1))+VAL(MID$(Q$,SP%+1)))
  END LOOP

END PROGRAM

  

You may also check:How to resolve the algorithm Sorting algorithms/Heapsort step by step in the TI-83 BASIC programming language
You may also check:How to resolve the algorithm Copy a string step by step in the X86-64 Assembly programming language
You may also check:How to resolve the algorithm Integer comparison step by step in the Maxima programming language
You may also check:How to resolve the algorithm Arithmetic/Integer step by step in the Ol programming language
You may also check:How to resolve the algorithm Quine step by step in the SmileBASIC programming language