0
A very difficult task "Mathevatics" !!!
I want to share with you my solution to the difficult task "Mathematics". This is my first big code. Perhaps he will help someone in some way. And I ask professionals not to judge strictly https://sololearn.com/compiler-playground/ceYVt3LI2Fa5/?ref=app
3 Réponses
+ 1
георгий осетинский
use size_t instead of int in your for-loops to get rid of the warnings in Sololearn.
You might have been using a compiler that allows comparison between int and size_t, but more strict compilers will raise a warning because you are comparing different types.
0
i don't get it, what should i input first ?
0
Find which math expression matches the answer that you are given, if you have an integer answer, and a list of math expressions.
Task:
Test each math expression to find the first one that matches the answer that you are given.
Input Format:
Two inputs: an integer and a space separated string of math expressions. The following operations need to be supported: addition +, subtraction -, multiplication *, division /.
An expression can include multiple operations.
Output Format:
A string that tells the index of the first math expression that matches. If there are no matches, output 'none'.
Sample Input:
15
(2+100) (5*3) (14+1)
Sample Output:
index 1