public static int reverse(int x) {
		int tmp_now = 0;
		int tmp_prv =0;
		int res = 0;
		boolean fu = false;
		if (x < 0) {
			x = -x;
			fu = true;
		}
		if(x<10){
			return x;
		}
		res = x % 10;//calc first
		x = x / 10;
		while (x != 0) {
			tmp_now = x % 10;
			res = res*10 + tmp_now;
			x = x / 10;
		}
		if (fu)
			res = -res;
		return res;
	}