Reversing the equation
Submissions: 512   Accuracy:

43.34%

  Difficulty: Easy   Marks: 2

Given a mathematical equation using numbers/variables and +, -, *, /. Print the equation in reverse.

Input:
The first line consists of an integer T i.e number of test cases. The first line and only line of each test case consists of an string s.

Output:
Print the string in reverse.

Constraints: 
1<=T<=100
1<=|Length of String|<=100

Example:
Input:

2
20-3+5*2
a+b*c-d/e

Output:
2*5+3-20
e/d-c*b+a

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Saksham Ashtputre
Author: saksham0751


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.