How to resolve the algorithm A+B step by step in the Plain English programming language
Published on 12 May 2024 09:40 PM
How to resolve the algorithm A+B step by step in the Plain English 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 Plain English programming language
Source code in the plain programming language
To run:
Start up.
Read a number from the console.
Read another number from the console.
Output the sum of the number and the other number.
Wait for the escape key.
Shut down.
To output the sum of a number and another number:
If the number is not valid, write "Invalid input" to the console; exit.
If the other number is not valid, write "Invalid input" to the console; exit.
Write the number plus the other number then " is the sum." to the console.
To decide if a number is valid:
If the number is not greater than or equal to -1000, say no.
If the number is not less than or equal to 1000, say no.
Say yes.
You may also check:How to resolve the algorithm Luhn test of credit card numbers step by step in the Plain English programming language
You may also check:How to resolve the algorithm Variadic function step by step in the Plain English programming language
You may also check:How to resolve the algorithm Leonardo numbers step by step in the Plain English programming language
You may also check:How to resolve the algorithm Temperature conversion step by step in the Plain English programming language
You may also check:How to resolve the algorithm Address of a variable step by step in the Plain English programming language