Sunday, March 9, 2014

SPOJ 2157. Anti-Blot System

http://www.spoj.com/problems/ABSYS/

This task is a simple implementation task. We have that the way of representation is num+num = num so we don't have any problems with many variables or different math operators its only a + operator. I suggest using C++ string because it will cover the difficulty of the input because the string reads up to the first space, so we need to read only 3 numbers (one of them is not a number) and check for the "non number" element , we will also need a function for turning a string into a number. So we have 3 elements n1,n2,n3. We don't have to worry if the "non number" element has some digits with him or not . If n1 is not a number then we transform the other 2 into numbers and n1=n3-n2 the same we do for n2 and n3. Make sure to check the source code for a better understanding.


       DOWNLOAD THE FULL SOURCE CODE

No comments:

Post a Comment