最大公约数
程序员文章站
2024-01-10 19:14:28
...
求两个整数的最大公约数 无 DECLARE @num1 BIGINT, @num2 BIGINT SET @num1=14SET @num2=21 DECLARE @times INT DECLARE @min INT DECLARE @result BIGINT IF( @num1 = @num2 ) SET @min=@num2 ELSE SET @min=@num1 SET @times=@min WHILE( @times = @min ) B
求两个整数的最大公约数DECLARE @num1 BIGINT, @num2 BIGINT SET @num1=14 SET @num2=21 DECLARE @times INT DECLARE @min INT DECLARE @result BIGINT IF( @num1 >= @num2 ) SET @min=@num2 ELSE SET @min=@num1 SET @times=@min WHILE( @times