Untitled

mail@pastecode.io avatar
unknown
plain_text
3 years ago
441 B
466
Indexable
Never
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in); 
		
		String str = sc.next(); 
		
		StringBuilder bd = new StringBuilder(str); 
		StringBuilder res = bd.reverse();   
		
		while(res.charAt(0)=='0') res.delete(0, 1);
		
		if(res.charAt(res.length()-1) == '-') { 
			res.delete(res.length()-1, res.length());
		} 		
		System.out.println(res);
	}
}