+ 2
How to do it???
The input is the expression x+y, where x and y are digits, i.e. integers from 0 to 9 inclusive. You need to calculate it and output the result. The first line contains a single integer t (1≤t≤100) — the number of input data sets. For example: Input: "5+3 6+8 7+3" Conclusion: "8 14 10"
3 Respostas
+ 4
What is your question?
edit:
Split the input at the blank space to separate the expressions.
Then you can split the individual expression at "+" to get get x and y. Once you have x and y, convert them to a numeric data type and add them
+ 3
That would be the lazy version that the teacher probably did not intend ;)
+ 2
Lisa maybe directly passing the splitted value in eval will be a better choice