整数反转函数

int reverse(int x){
	int ans = 0;
	while (x){
		ans *= 10;
		ans += x % 10;
		x /= 10;
	}
	return ans;
}
posted @ 2023-12-07 21:29  Green_wang  阅读(14)  评论(0)    收藏  举报