Home  >  Article  >  Database  >  求整数的逆序数

求整数的逆序数

WBOY
WBOYOriginal
2016-06-07 14:55:041327browse

整数逆序数 无 DECLARE @INPUT BIGINT,@RESULT BIGINTSET @INPUT=1234SET @RESULT=0while @INPUT0BEGINSET @RESULT=@RESULT*10+@INPUT%10SET @INPUT=@INPUT/10ENDSELECT @RESULT

整数逆序数
DECLARE @INPUT BIGINT,@RESULT BIGINT
SET @INPUT=1234
SET @RESULT=0
while @INPUT>0
BEGIN
SET @RESULT=@RESULT*10+@INPUT%10
SET @INPUT=@INPUT/10
END
SELECT @RESULT
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn