Xem code

mail@pastecode.io avatar
unknown
plain_text
3 years ago
592 B
0
Indexable
Never
/**
 * 
 */
package BaiTap;

import java.util.*;

/**
 * @author Linh Tran Bao
 * @since Jul 10, 2021
 */
public class DaoNguoc {
	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();   //0123 //00123
		
		
		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);
		

		

	}
}