declare @ch nchar(10),@n int,@a int set @n=20 set @ch='' print cast(@n as varchar(5))+'的二进制为:' while @n<>0 begin set @[email protected]%2 set @[email protected]/2 set @ch=char([email protected])[email protected] end print @ch
结果为:
20的二进制为:
10100
时间: 2024-10-14 00:19:39